Skip to content

Commit

Permalink
Separate build and push steps for log clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Mar 11, 2024
1 parent 68d7b24 commit c0a8768
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/sgdk-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GHCR (push events only)
- name: Login to GHCR (only on push event)
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
Expand All @@ -62,15 +62,22 @@ jobs:
gcc:
- deps/gcc.Dockerfile
- name: If changed, build (and maybe push) m68k GCC
- name: Build m68k GCC (only if changed)
if: steps.changed-files.outputs.gcc_any_changed == 'true'
uses: docker/build-push-action@v5
with:
file: deps/gcc.Dockerfile
context: deps/
platforms: ${{ env.PLATFORMS }}
tags: ghcr.io/${{ github.actor }}/sgdk-m68k-gcc:latest
push: ${{ github.event_name == 'push' }}
push: false

# Push is a separate step so the build logs are clearly separate from the
# push logs.
- name: Push m68k GCC (only if changed, only on push event)
if: steps.changed-files.outputs.gcc_any_changed == 'true' && github.event_name == 'push'
run: |
docker image push ghcr.io/${{ github.actor }}/sgdk-m68k-gcc:latest
# NOTE: If you are seeing failures in this job right after forking SGDK,
# you may need to bootstrap the base image into your fork on ghcr.io.
Expand All @@ -80,7 +87,7 @@ jobs:
# ghcr.io/YOUR_NAMEE/sgdk-m68k-gcc:latest
# gh auth token | docker login ghcr.io -u YOUR_NAME --password-stdin
# docker image push ghcr.io/YOUR_NAMEE/sgdk-m68k-gcc:latest
- name: Build (any maybe push) SGDK
- name: Build SGDK
uses: docker/build-push-action@v5
with:
file: Dockerfile
Expand All @@ -89,4 +96,11 @@ jobs:
build-args: |
BASE_IMAGE=ghcr.io/${{ github.actor }}/sgdk-m68k-gcc
tags: ghcr.io/${{ github.actor }}/sgdk:latest
push: ${{ github.event_name == 'push' }}
push: false

# Push is a separate step so the build logs are clearly separate from the
# push logs.
- name: Push SGDK (only on push event)
if: github.event_name == 'push'
run: |
docker image push ghcr.io/${{ github.actor }}/sgdk-m68k-gcc:latest

0 comments on commit c0a8768

Please sign in to comment.