1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/.github/workflows
Gastón Fournier 4599e5cc06
chore: Optimize docker build oss (#3951)
## About the changes
Reduce the build time of OSS docker image from
[~30m](https://github.com/Unleash/unleash/actions/workflows/docker_publish.yaml)
to [under
15m](https://github.com/Unleash/unleash/actions/runs/5222180536/jobs/9427342758)

1. Build frontend outside docker multiplatform.
2. Allow `frontend/build` to be copied to the image by removing this
from `.dockerignore`
3. Run with `--ignore-scripts` to avoid building the frontend on the
`prepare` script, but this requires us to run all the prepare scripts
manually (except the frontend build).
 
**Note:** we need to build frontend in the `prepare` script to be able
to have source code dependencies

## Manual Testing
Manually downloaded from
https://hub.docker.com/r/unleashorg/unleash-server/tags?page=1 and
compared both `unleash` folders from main and the version built with the
new process
https://github.com/Unleash/unleash/actions/runs/5223078089/jobs/9429430190#step:5:48

![Screenshot from 2023-06-10
21-11-33](https://github.com/Unleash/unleash/assets/455064/60a41739-904d-480d-8d80-bf17b7a70432)

No major difference was spotted (only expected changes due to
development done in main)

**Command used to extract the contents:** 

```
cd /tmp
mkdir main && cd main
docker pull unleashorg/unleash-server:main-edge-18-alpine
docker export $(docker create unleashorg/unleash-server:main-edge-18-alpine) > container.tar && tar xvf container.tar
mkdir ../new-process && cd ../new-process
docker pull unleashorg/unleash-server:sha-ccac902-18-alpine
docker export $(docker create unleashorg/unleash-server:sha-ccac902-18-alpine) > container.tar && tar xvf container.tar
meld ./unleash ../main/unleash
```
2023-06-12 09:15:09 +02:00
..
add-to-project.yml
auto-assign-pr-author.yaml
build_coverage.yaml
build_doc_prs.yaml
build_frontend_prs.yml
build_prs_jest_report.yaml
build_prs_test_report.yaml task: Add Unit test result check task (#3695) 2023-05-25 11:03:54 +00:00
build_prs.yaml task: Add Unit test result check task (#3695) 2023-05-25 11:03:54 +00:00
build.yaml chore(deps): update aws-actions/configure-aws-credentials action to v2 (#3893) 2023-06-06 15:03:11 +02:00
check_links.yaml chore(deps): update lycheeverse/lychee-action action to v1.8.0 (#3839) 2023-05-23 15:19:23 +02:00
codeql-analysis.yml
docker_publish.yaml chore: Optimize docker build oss (#3951) 2023-06-12 09:15:09 +02:00
e2e.frontend.yaml
flag-no-response.yaml
generate-docs.yaml
gradual-strict-null-checks.yml chore: disable null checks until we have time to fix this (#3830) 2023-05-22 18:06:52 +02:00
notify_enterprise.yaml chore(deps): update aws-actions/configure-aws-credentials action to v2 (#3893) 2023-06-06 15:03:11 +02:00
pr_add_test_results.yaml task: Add Unit test result check task (#3695) 2023-05-25 11:03:54 +00:00
publish-new-version.yaml
release_changelog.yml
release.yaml chore: avoid building frontend twice (#3918) 2023-06-08 10:48:28 +02:00
reset_heroku.yml chore(deps): update actions/checkout action to v3 (#3891) 2023-05-29 17:47:30 +02:00
update_contributors.yaml chore(deps): update aws-actions/configure-aws-credentials action to v2 (#3893) 2023-06-06 15:03:11 +02:00