-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch to use cloud builders for native multi-arch support (#7)
* ci: initial cloud builder test * ci: update metadata tag * ci: add pr meta for testing * ci: update path to bake file * ci: multi-arch test * ci: test push * ci: add tag trigger * ci: update image path * ci: remove old workflow * ci: switch to reusable workflow * build: switch tag to main for the reusable workflow
- Loading branch information
Showing
5 changed files
with
77 additions
and
174 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,57 @@ | ||
--- | ||
# Automatically build Docker images using a cloud builder and publish them to a | ||
# container registry using HCL Bake file. | ||
|
||
name: Build Docker Images using Cloud Builder | ||
|
||
on: | ||
# workflow_dispatch: | ||
# pull_request: | ||
# branches: ['main'] | ||
push: | ||
branches: ['main'] | ||
tags: ['*'] | ||
|
||
jobs: | ||
# When pushing into main will build the regular multi-arch image | ||
# For pull requests will use the default target to only | ||
# generate local architecture version | ||
bake-target: | ||
name: Determine bake target | ||
runs-on: ubuntu-22.04 # don't use the big runners for this small step | ||
outputs: | ||
target: ${{ steps.generate.outputs.bake_target }} | ||
steps: | ||
- name: Determine target | ||
id: generate | ||
run: | | ||
# NOTE: Using direct target names instead of group names as its a single | ||
# image build and want to use the target as part of the output image tag | ||
if [[ '${{ github.event_name }}' == 'pull_request' ]]; then | ||
TGT=askem-julia-base | ||
else | ||
TGT=askem-julia | ||
fi | ||
echo "$TGT" | ||
echo "bake_target=${TGT,,}" >> ${GITHUB_OUTPUT} | ||
- name: Show Generated Tag | ||
run: echo ${{ steps.generate.outputs.bake_target }} | ||
|
||
# Build and Publish all targets associated with specified group | ||
bake: | ||
needs: | ||
- bake-target | ||
uses: darpa-askem/.github/.github/workflows/bake-publish-cloud-builder.yaml@main | ||
with: | ||
file: 'docker/docker-bake.hcl' | ||
group: ${{ needs.bake-target.outputs.target }} | ||
registry: 'ghcr.io' | ||
organization: ${{ github.repository_owner }} | ||
secrets: | ||
username: ${{ secrets.DOCKER_CLOUD_BUILD_USERNAME }} | ||
token: ${{ secrets.DOCKER_CLOUD_BUILD_TOKEN }} | ||
endpoint: "${{ secrets.DOCKER_CLOUD_BUILD_ENDPOINT }}" | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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