-
Notifications
You must be signed in to change notification settings - Fork 29
feat: docker multi-arch reusable workflow #1348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
5f319c8
to
b00802f
Compare
exit 1 | ||
fi | ||
env: | ||
PRE_BUILD_SCRIPT_PATH: ${{ inputs.pre-build-script }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would personally prefer {pre,post}build scripts to be inline, IE:
name: Build and Push and Push MultiArch
on: push
jobs:
build-push-multiarch:
uses: grafana/shared-workflows/.github/workflows/build-and-push-docker-multiarch.yml@rwhitaker/multi-arch-builds
pre-build: |
some-cool-command --do-something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is being passed as an input... what would that look like here? Would we need the users to pass their script inline, or could we take the script file and parse it out and execute it somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking something like:
name: Run custom build script if it exists
if: ${{ inputs.pre-build != '' }}
run: |
{ echo "#!/bin/bash"; echo "${PRE_BUILD}" } > /tmp/pre-build.sh
chmod a+x /tmp/pre-build.sh
exec /tmp/pre-build.sh
env:
PRE_BUILD: ${{ inputs.pre-build }}
8c455f3
to
9f72d18
Compare
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
with: | ||
persist-credentials: false | ||
- name: Run custom build script if it exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bit of feedback -- take it or leave it 🙂
I would consider leaving the scripting components out of the "boxed up" reusable workflow. I think it's OK enough to say that if you need to run code before/after your build then you can use the "parts-based" workflow. It gives people the flexibility to do more than you can do with a script too, for example to use third party actions.
This pull request introduces a reusable workflow that uses a matrix strategy to perform native multi-arch docker builds for
arm64
andamd64
builds.It uses the 3 new composite actions from #1347.
Part of https://github.com/grafana/deployment_tools/issues/320068