Skip to content

Commit

Permalink
Pick the makefile rule based on event type.
Browse files Browse the repository at this point in the history
Also split the multiarch builder creation and the actual build.
  • Loading branch information
outlyer-net committed Apr 25, 2024
1 parent aaad257 commit 481ea6c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,25 @@ jobs:
make print-tags \
| sed -e 's/^/extra_tags=/' \
| tee -a "$GITHUB_OUTPUT"
- name: Create multiarch builder
run: make multiarch-builder

# Decide whether we'll push
# \-> Don't push on pull requests
- name: Set-up action
id: action
run: |
if test ${{ github.event_name }} != 'pull_request' ; then
echo 'rule=push'
else
echo 'rule=buildx'
fi | tee -a "$GITHUB_OUTPUT"
# Non-standard using the makefile:
- name: Build
- name: Build/Push
# IMAGE_NAME must match the github repository name
run: |
make multiarch-builder && \
make push \
make ${{ steps.action.outputs.rule }} \
ADD_TAGS="${{ steps.meta.outputs.tags }} ${{ steps.dockerhub_tags.outputs.extra_tags }}" \
REGISTRY=${{ env.REGISTRY }} \
IMAGE_NAME=${{ env.IMAGE_NAME }}

0 comments on commit 481ea6c

Please sign in to comment.