Skip to content

Commit ab9c37f

Browse files
committed
User docker actions to publish
1 parent 5825bc5 commit ab9c37f

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,41 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
env:
10+
REGISTRY: docker.io
11+
IMAGE_NAME: knuthuehne/jedeschule-scrapers
12+
permissions:
13+
packages: write
14+
contents: read
15+
attestations: write
16+
id-token: write
917
steps:
10-
- uses: actions/checkout@v1
11-
- name: Publish to Registry
12-
uses: elgohr/[email protected]
18+
- uses: actions/checkout@v4
19+
- name: Log in to Docker Hub
20+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
1321
with:
14-
name: knuthuehne/jedeschule-scrapers
1522
username: ${{ secrets.DOCKER_USERNAME }}
1623
password: ${{ secrets.DOCKER_PASSWORD }}
17-
default_branch: main
24+
- name: Extract metadata (tags, labels) for Docker
25+
id: meta
26+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
27+
with:
28+
images: ${{ env.IMAGE_NAME}}
29+
- name: Build and push Docker image
30+
id: push
31+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
32+
with:
33+
context: .
34+
file: ./Dockerfile
35+
push: true
36+
tags: ${{ steps.meta.outputs.tags }}
37+
labels: ${{ steps.meta.outputs.labels }}
38+
- name: Generate artifact attestation
39+
uses: actions/attest-build-provenance@v2
40+
with:
41+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
42+
subject-digest: ${{ steps.push.outputs.digest }}
43+
push-to-registry: true
1844
deploy:
1945
needs: build
2046
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)