Skip to content
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

Restore safe Docker publishing #239

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/_buildpacks-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:

publish-docker:
name: Publish → Docker - ${{ matrix.buildpack_id }}
needs: [compile]
needs: [ compile ]
colincasey marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -156,7 +156,7 @@ jobs:
steps:
# Composite buildpacks that depend on bash buildpacks (like
# heroku/nodejs-function) refer to bash buildpacks by their source
# location rather than the packaged location. Other buildpacks don't
# location rather than the packaged location. Other buildpacks
# don't need this step, so it's skipped where possible.
- name: Checkout
if: matrix.buildpack_type == 'composite'
Expand Down Expand Up @@ -186,7 +186,12 @@ jobs:
username: ${{ secrets.docker_hub_user }}
password: ${{ secrets.docker_hub_token }}

- name: Check if version is already on Docker Hub
id: check
run: echo "published_to_docker=$(docker manifest inspect "${{ matrix.stable_tag }}" &> /dev/null && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT

- name: Publish to temporary tags
if: steps.check.outputs.published_to_docker == 'false'
env:
TARGETS: ${{ toJSON(matrix.targets) }}
run: |
Expand Down Expand Up @@ -222,7 +227,7 @@ jobs:
fi

- name: Promote temporary tags to stable tags
if: inputs.dry_run == false
if: inputs.dry_run == false && steps.check.outputs.published_to_docker == 'false'
env:
TARGETS: ${{ toJSON(matrix.targets) }}
run: |
Expand Down Expand Up @@ -270,7 +275,7 @@ jobs:

publish-github:
name: Publish → GitHub Release
needs: [compile]
needs: [ compile ]
runs-on: ${{ inputs.ip_allowlisted_runner }}
steps:
# Composite buildpacks that depend on bash buildpacks (like
Expand Down Expand Up @@ -332,7 +337,7 @@ jobs:

publish-cnb-registry:
name: Publish → CNB Registry - ${{ matrix.buildpack_id }}
needs: [compile, publish-docker]
needs: [ compile, publish-docker ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -367,7 +372,7 @@ jobs:

update-builder:
name: Update Builder
needs: [compile, publish-docker, publish-cnb-registry, publish-github]
needs: [ compile, publish-docker, publish-cnb-registry, publish-github ]
runs-on: ${{ inputs.ip_allowlisted_runner }}
steps:
- name: Get token for GH application (Linguist)
Expand Down