Skip to content

Conversation

ricky-undeadcoders
Copy link
Contributor

@ricky-undeadcoders ricky-undeadcoders commented Sep 24, 2025

This pull request introduces a reusable workflow that uses a matrix strategy to perform native multi-arch docker builds for arm64 and amd64 builds.

It uses the 3 new composite actions from #1347.
Part of https://github.com/grafana/deployment_tools/issues/320068

exit 1
fi
env:
PRE_BUILD_SCRIPT_PATH: ${{ inputs.pre-build-script }}
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

@juliajohannesen juliajohannesen Oct 15, 2025

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 }}

@ricky-undeadcoders ricky-undeadcoders force-pushed the rwhitaker/multi-arch-shared-workflow branch from 8c455f3 to 9f72d18 Compare October 15, 2025 16:19
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Run custom build script if it exists
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants