Skip to content

Commit

Permalink
actions: Add action to publish to Github Container Registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanralphaviles committed Dec 27, 2024
1 parent 9ef8f2c commit 763f887
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,35 @@ on:
push:
branches:
- master
- update
workflow_dispatch:

jobs:
docker-build-push:
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
id-token: write
packages: write
steps:
- name: Login to Docker Hub
uses: docker/#-action@v3
with:
registry: docker.io
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Github Container Registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
jraviles/adsbhub
ghcr.io/jeanralphaviles/adsbhub
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
Expand All @@ -42,10 +49,16 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: jraviles/adsbhub:latest,jraviles/adsbhub:arm,jraviles/adsbhub:amd64,jraviles/adsbhub:arm64
tags: jraviles/adsbhub:latest,ghcr.io/jeanralphaviles/adsbhub:latest,jraviles/adsbhub:arm,jraviles/adsbhub:amd64,jraviles/adsbhub:arm64
- name: Generate Artifact Attestation for Docker Hub
uses: actions/attest-build-provenance@v2
with:
subject-name: docker.io/jraviles/adsbhub
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- name: Generate Artifact Attestation for Github Container Registry
uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/jeanralphaviles/adsbhub
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 763f887

Please # to comment.