Skip to content

Commit

Permalink
update docker-publish workflow, disable provenance when building imag…
Browse files Browse the repository at this point in the history
…es (#57)

fixes #56

Signed-off-by: Alex Price <[email protected]>
  • Loading branch information
awprice authored Jun 9, 2023
1 parent 951618e commit b7f20c4
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
env:
IMAGE_NAME: cyclops

jobs:
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
Expand All @@ -27,15 +27,20 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Set short sha variable
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"

- name: Log into GitHub Container Registry
# a PAT with `read:packages` and `write:packages` scopes is an Actions secret `CR_PAT`.
# Doesn't support Org or Repo level PATs and no bot accounts
run: echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ secrets.CR_PAT_USER }} --password-stdin
# Log in to GitHub Container registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
# a PAT with `read:packages` and `write:packages` scopes is an Actions secret `CR_PAT`.
# Doesn't support Org or Repo level PATs and no bot accounts
username: ${{ secrets.CR_PAT_USER }}
password: ${{ secrets.CR_PAT }}

- name: Push image to GitHub Container Registry
run: |
Expand All @@ -54,8 +59,11 @@ jobs:
echo VERSION=$VERSION
for ARCH in amd64 arm64; do
docker buildx build -t $IMAGE_ID:$VERSION-$ARCH --platform=linux/${ARCH} --push .
# Disable provenance, as this causes issues when creating the manifest
# See https://github.com/atlassian-labs/cyclops/issues/56
docker buildx build --provenance=false -t $IMAGE_ID:$VERSION-$ARCH --platform=linux/${ARCH} --push .
done
docker manifest create $IMAGE_ID:$VERSION \
$(for ARCH in amd64 arm64; do echo $IMAGE_ID:$VERSION-$ARCH; done)
docker manifest push $IMAGE_ID:$VERSION

0 comments on commit b7f20c4

Please sign in to comment.