28 Commits (20bf0e8a65595525e54ae6bf796d971524e994e7)

Author SHA1 Message Date
Dimitri Huisman 0d048d24d3
Fix build.hcl / CI.yml regarding labels
The version label and versions passed to docs image were based on
the tag. Now we first build the images with -build appended to the
tag, we cannot use the tag as version label.

A new env var is introduced to pass the version to the build.hcl file.
This will be used to set the VERSION label in the image, and pass
as build arguments to the docs image.
2 years ago
Dimitri Huisman 120cd34989
Switch the container registry used for deploying images from docker
to ghcr.io (github). Images are now first build with '-build'
appended to the tag. E.g. ghcr.io/mailu/admin:master-build.
This is to prevent the image being available before automatic testing has completed.
In the deploy job, the final image is pushed (this still works the same).

Update setup & documentation for switch to ghcr.io
2 years ago
Florent Daigniere 3e45a791cf Implement oletools to filter out bad macros 2 years ago
Florent Daigniere d3d7916b58 Merge remote-tracking branch 'upstream/master' into upgrade-alpine 2 years ago
Florent Daigniere e79d7fed55 Reduce the number of warnings on the CI 2 years ago
Florent Daigniere dc9e2a3e70 Upgrade Snappymail to 2.21 and merge the webmail containers 2 years ago
Dimitri Huisman 2a3266b6b8
Forgot to update both deploy jobs 2 years ago
Dimitri Huisman b2e47642f7
Tag the images with latest tag as well. 2 years ago
Dimitri Huisman db7ce8c83e
Login docker.io to prevent rate limiting for pulling images 2 years ago
Dimitri Huisman b3151e9904
Actually push the build arm images to ghcr.io 2 years ago
Dimitri Huisman 6549dbf247
Sigh. needs.* context is only available if you include it in needs: 2 years ago
Dimitri Huisman c7cba1b075
Finishing touches for fixing arm builds
- Use self-hosted runners for arm base image
- Use seperate docker image cache for arm build
- Remove unneeded needs items.
2 years ago
Dimitri Huisman e915e444e9
Remove superfluous cache export entry for arm 2 years ago
Dimitri Huisman 4be0cbf4da
Switch workflow to ghcr.io
- Build images & build cache are pushed to ghcr.io.
- Tests will make use of the images pushed to ghcr.io.
- Deploy step only copies images from ghcr.io to docker.io.
- Resolves strange build errors tied to buildx+intermediate builds
- Results in quicker build times.
2 years ago
Dimitri Huisman 451738e32b We want the function result. Not the function statement. 2 years ago
Dimitri Huisman f9ba0e688f Removed syntax error 2 years ago
Dimitri Huisman 92cb8c146b Refine build_test_deploy.yml:
Build base image before the other images.
Change cache key to make it is re-used for all builds. This is not
dangerous. The docker build process can determine itself whether
a cache can be safely re-used or not.
2 years ago
Florent Daigniere 254277a829
runner.temp is what should be used 2 years ago
Dimitri Huisman 22fe65e4d8 Use RUNNER_TEMP for storing cache files. 2 years ago
Dimitri Huisman 56d0e795eb
Push arm images via arm self-hosted runner 2 years ago
Dimitri Huisman d76d3b4959 Switch to ARM64 self-hosted for ARM build 2 years ago
Dimitri Huisman 5732b2316f Switch to local build cache, cached via actions/cache@v3
The previous method of using gha cache via buildx proved to be
unreliable. Using local cache via actions/cache@v3 is much more
reliable.
The build job will re-use cache from previous workflow runs.
The total workflow time is still similar ~12 minutes.
2 years ago
Dimitri Huisman 312a733ae3 prefix the cache key with a hash (to help with sharding) 2 years ago
Dimitri Huisman f35d82b3a0 Also ${{ github.run_id }} for cache key.
This makes rue that the cache key is unique across workflow runs
2 years ago
Dimitri Huisman d56eb16f52 Hotfix for workflow. For build step do not build from cache.
Make sure cache layers are unique by using ${{ github.ref }}
2 years ago
Dimitri Huisman dd3f1a3376 Switch to mode=min for GHA cache for docker buildx to prevent ratelimiting in GHA workflow 2 years ago
Dimitri Huisman 7e21ab4007 Merge master cont'd 2 years ago
Dimitri Huisman f6de2b2938 Switch from docker build to buildx for CI/CD.
- The main workflow file has been optimised and simplified.
- Images are built in parallel when building locally resulting in faster build times.
- The github action workflow is about 50% faster.
- Arm images are built as well. These images are not tested due to restrictions of github actions (no arm runners). The tags of the images have -arm appended to it.
- Arm images can also be built locally.
- Reusable workflow is introduced for building, testing and deploying the images.
  This allows the workflow to be reused for other purposes in the future.
- Workflow can be manually triggered. This allows forked Mailu projects to also use the workflow for building images.
2 years ago