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