Skip to content

Commit 3e91a9c

Browse files
fix: Build Docker image workflow (#4)
* fix: Build image workflow * fix: Relocate permissions block? * chore: Add a test to workflow to check things * fix: Debugging snippet needed the matrix * fix: Output entire JSON from REST API * fix: Still trying to debug * fix: One last verification of the token * fix: Test permissions * fix: Restore workflow
1 parent 1b78031 commit 3e91a9c

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/build-image.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@ name: Publish container image
22

33
on:
44
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/build-image.yaml
8+
- Dockerfile*
59
release:
610
types:
711
- created
812
schedule:
9-
- cron: 00 00 * * 0
10-
11-
permissions:
12-
contents: read
13-
# for docker/build-push-action to publish docker image
14-
packages: write
13+
- cron: 00 00 * * *
1514

1615
env:
1716
REGISTRY: ghcr.io
1817

1918
jobs:
2019
docker:
2120
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
packages: write
24+
attestations: write
25+
id-token: write
2226
strategy:
27+
fail-fast: false
2328
matrix:
2429
include:
2530
- dockerfile: Dockerfile
@@ -51,9 +56,9 @@ jobs:
5156
type=ref,event=branch
5257
type=ref,event=pr
5358
type=sha
54-
type=raw,value=latest,enable={{is_default_branch}}
55-
type=raw,value={{github.ref_name}},enable={{github.ref_type == 'tag'}}
56-
type=raw,value=nightly,enable={{github.event_name == 'schedule'}}
59+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
60+
type=raw,value=${{ github.ref_name }},enable=${{ github.ref_type == 'tag' }}
61+
type=raw,value=nightly,enable=${{ github.event_name == 'schedule' }}
5762
5863
- name: Build and Push release
5964
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0

0 commit comments

Comments
 (0)