Skip to content

Commit

Permalink
Create test-deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AB-xdev committed Oct 24, 2024
1 parent 612ba71 commit 16199b8
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test Deployment

on:
workflow_dispatch:

jobs:
publish-docker:
runs-on: ubuntu-latest
needs: publish-maven
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to ghcr.io
uses: docker/login-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: |
${{ secrets.DOCKERHUB_USERNAME }}/oidc-server-mock
ghcr.io/${{ github.repository }}
tags: |
experimental
- uses: docker/build-push-action@v6
id: push
with:
context: ./src
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,compression=zstd,force-compression=true

- name: Generate artifact attestation (ghcr.io)
uses: actions/attest-build-provenance@v1
with:
subject-name: ghcr.io/${{ github.repository }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit 16199b8

Please sign in to comment.