-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: Build base images for ARM64 platform in a seperate daily job
Why this change? We're currently building a base image for arm64 platforms as part of the CI workflow. However, building it on Github action via emulation is too slow and makes it meaningless to include as part of the CI workflow. What does this change do? This change moves the building of the bage image targeting the arm64 platform completely to a scheduled job that runs outside of the normal CI workflow. This will also enable us to build the images for the test and dev environment eventually as part of the workflow which we intend to do in a follow up commit.
- Loading branch information
Showing
3 changed files
with
82 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
on: | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
concurrency: | ||
group: build-arm64-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
BUILDKIT_PROGRESS: plain | ||
|
||
jobs: | ||
base: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm64 | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: build slim image | ||
run: | | ||
cd image && ruby auto_build.rb base_slim_arm64 | ||
- name: tag slim images | ||
id: tag-images | ||
run: | | ||
TAG=`date +%Y%m%d-%H%M` | ||
echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT | ||
docker tag discourse/base:build_slim_arm64 discourse/base:2.0.$TAG-slim-arm64 | ||
docker tag discourse/base:build_slim_arm64 discourse/base:slim-arm64 | ||
- name: build release image | ||
run: | | ||
cd image && ruby auto_build.rb base_arm64 | ||
- name: tag release images | ||
run: | | ||
TAG=${{ steps.tag-images.outputs.tag }} | ||
docker tag discourse/base:build_arm64 discourse/base:2.0.$TAG-arm64 | ||
docker tag discourse/base:build_arm64 discourse/base:release-arm64 | ||
- name: build test_build image | ||
run: | | ||
cd image && ruby auto_build.rb discourse_test_build_arm64 | ||
- name: run specs | ||
run: | | ||
docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build_arm64 | ||
- name: Print summary | ||
run: | | ||
docker images discourse/base | ||
- name: push to dockerhub | ||
if: success() && (github.ref == 'refs/heads/main') | ||
env: | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
run: | | ||
TAG=${{ steps.tag-images.outputs.tag }} | ||
docker login --username discoursebuild --password $DOCKERHUB_PASSWORD | ||
docker push discourse/base:2.0.$TAG-slim-arm64 | ||
docker push discourse/base:slim-arm64 | ||
docker tag discourse/base:slim-arm64 discourse/base:aarch64 | ||
docker push discourse/base:2.0.$TAG-arm64 | ||
docker push discourse/base:release-arm64 | ||
docker push discourse/base:aarch64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters