Skip to content

Commit

Permalink
fixup! 👷 Inspect all necessary stages
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Mar 28, 2023
1 parent 2de9df1 commit e8ce4cd
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/build_stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
name: Build C-PAC stage images for Ubuntu & FSL data
strategy:
matrix:
Dockerfile: ${{ inputs.phase_one }}
Dockerfile: ${{ fromJSON(inputs.phase_one) }}
env:
REBUILD: ${{ inputs.rebuild_phase_one }}
runs-on: ubuntu-latest
Expand All @@ -71,24 +71,24 @@ jobs:
docker buildx imagetools inspect $DOCKER_TAG >/dev/null || echo "not_yet_exists=1" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- name: Clear up some space on runner
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Docker Buildx
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/setup-buildx-action@v2.2.1
- name: Log in to GitHub Container Registry
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/build-push-action@v3.2.0
with:
file: .github/Dockerfiles/${{ matrix.Dockerfile }}.Dockerfile
Expand All @@ -103,7 +103,7 @@ jobs:
needs: Ubuntu
strategy:
matrix:
Dockerfile: ${{ inputs.phase_two }}
Dockerfile: ${{ fromJSON(inputs.phase_two) }}
env:
REBUILD: ${{ inputs.rebuild_phase_two }}
runs-on: ubuntu-latest
Expand All @@ -123,32 +123,32 @@ jobs:
cat $GITHUB_OUTPUT
if: always()
- name: Prep Dockerfiles for forked repository
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
run: |
.github/scripts/local_ghcr .github/Dockerfiles/${{ matrix.Dockerfile }}.Dockerfile ${{ github.repository_owner }} $DOCKER_TAG
cat .github/Dockerfiles/${{ matrix.Dockerfile }}.Dockerfile
- name: See Dockerfile
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
run: cat .github/Dockerfiles/${{ matrix.Dockerfile }}.Dockerfile
- name: Clear up some space on runner
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Docker Buildx
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/setup-buildx-action@v2.2.1
- name: Log in to GitHub Container Registry
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
if: contains(env.REBUILD, matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.Dockerfile) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/build-push-action@v3.2.0
with:
context: .
Expand All @@ -168,7 +168,7 @@ jobs:
REBUILD: ${{ inputs.rebuild_phase_three }}
strategy:
matrix:
variant: ${{ inputs.phase_three }}
variant: ${{ fromJSON(inputs.phase_three) }}
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v4
Expand Down Expand Up @@ -198,32 +198,32 @@ jobs:
id: docker_tag
if: always()
- name: Clear up some space on runner
if: contains(env.REBUILD, matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Set up Docker Buildx
if: contains(env.REBUILD, matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/setup-buildx-action@v2.2.1
- name: Log in to GitHub Container Registry
if: contains(env.REBUILD, matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prep Dockerfiles for forked repository
if: contains(env.REBUILD, matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
run: |
.github/scripts/local_ghcr .github/Dockerfiles/base-${{ matrix.variant }}.Dockerfile ${{ github.repository_owner }} $DOCKER_TAG
cat .github/Dockerfiles/base-${{ matrix.variant }}.Dockerfile
- name: See Dockerfile
if: contains(env.REBUILD, matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
run: cat .github/Dockerfiles/base-${{ matrix.variant }}.Dockerfile
- name: Build and push base image
if: contains(env.REBUILD, matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
if: contains(fromJSON(env.REBUILD), matrix.variant) || steps.docker_tag.outputs.not_yet_exists == 1
uses: docker/build-push-action@v3.2.0
with:
context: .
Expand Down

0 comments on commit e8ce4cd

Please sign in to comment.