fixup! Use Docker login action

This commit is contained in:
Alexis Métaireau 2024-11-27 15:27:16 +01:00
parent ed0ba39796
commit 6d78e3b4cb
No known key found for this signature in database
GPG key ID: C65C7A89A8FFC56E

View file

@ -12,12 +12,12 @@ on:
permissions:
id-token: write
packages: write
contents: read
attestations: write
packages: write
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_NAME: dangerzone/dangerzone
@ -27,6 +27,12 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: USERNAME
password: ${{ github.token }}
- name: Build and push the dangerzone image
id: build-image
@ -37,7 +43,7 @@ jobs:
gunzip -c share/container.tar.gz | podman load
podman push \
dangerzone.rocks/dangerzone \
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
DIGEST=$(podman images --filter "reference=dangerzone.rocks/dangerzone" --format "{{ .Digest }}")
echo "Digest: ${DIGEST}"
echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT"
@ -45,6 +51,6 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: "${{ steps.build-image.outputs.digest }}"
push-to-registry: true