Skip to content

Commit

Permalink
fix: Docker release (#95)
Browse files Browse the repository at this point in the history
Needs to be in the same workflow because using GITHUB_TOKEN
a workflow run will not trigger another workflow.
  • Loading branch information
ddeboer authored Jun 27, 2024
1 parent 03c8834 commit fcf0adb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 43 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/docker.yml

This file was deleted.

37 changes: 35 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
contents: read

jobs:
build:
npm:
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -17,7 +17,7 @@ jobs:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm ci
Expand All @@ -26,3 +26,36 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

docker:
needs: npm
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
- uses: docker/build-push-action@v5
id: push
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.output.labels }}
- uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit fcf0adb

Please sign in to comment.