diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..13612f1 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,50 @@ +name: Publish Docker image + +on: push + +jobs: + publish-images: + name: Publish Docker Images + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + steps: + - + name: Check out repo + uses: actions/checkout@v4 + + - + name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + + - + name: Login to GitHub Packages + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - + name: Build and push Docker image + id: push + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + - + name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ghcr.io/${{ github.repository }} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true diff --git a/Dockerfile b/Dockerfile index 42089a2..a78ebbb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,10 @@ RUN set -eux; \ FROM alpine:3.19 +LABEL org.opencontainers.image.source=https://github.com/codedmonkey/conductor +LABEL org.opencontainers.image.description="Conductor PHP Package Registry" +LABEL org.opencontainers.image.licenses=MIT + ARG UID=1000 ARG GID=1000