Skip to content

Commit 29a5e0f

Browse files
committedMar 29, 2024··
feat(): also push docker images to GHCR
1 parent 5539040 commit 29a5e0f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎.github/workflows/docker-image.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212

1313
permissions:
1414
contents: read
15+
packages: write
1516
pull-requests: write
1617

1718
env:
@@ -32,12 +33,19 @@ jobs:
3233
with:
3334
username: ${{ secrets.DOCKERHUB_USERNAME }}
3435
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
- name: Login to GitHub Container Registry
37+
uses: docker/login-action@v3
38+
with:
39+
registry: ghcr.io
40+
username: ${{ github.repository_owner }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
3542
- name: Extract Docker metadata
3643
id: meta
3744
uses: docker/metadata-action@v5
3845
with:
3946
images: |
4047
${{ vars.DOCKERHUB_IMAGE }}
48+
${{ vars.GHCR_IMAGE }}
4149
labels: |
4250
org.opencontainers.image.title=docker-diskmark
4351
org.opencontainers.image.description=A disk benchmarking tool for Docker
@@ -64,7 +72,7 @@ jobs:
6472
uses: docker/scout-action@v1
6573
with:
6674
command: cves,recommendations,compare
67-
image: ${{ steps.meta.outputs.tags }}
75+
image: ${{ vars.DOCKERHUB_IMAGE }}:${{ env.SHA }}
6876
to: ${{ vars.DOCKERHUB_IMAGE }}:latest
6977
ignore-base: true
7078
ignore-unchanged: true

0 commit comments

Comments
 (0)
Please sign in to comment.