Skip to content

Commit

Permalink
feat: updating github workflow for building docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNickOfTime committed Jul 16, 2024
1 parent 469a01c commit eea0592
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/docker-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ on:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
REPO_OWNER: ${{ github.repository_owner }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: handbrake-web-server
file: worker/Dockerfile

- image: handbrake-web-worker
file: server/Dockerfile

permissions:
contents: read
Expand All @@ -37,7 +46,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/${{ matrix.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
Expand All @@ -49,6 +58,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.file }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -57,6 +67,6 @@ jobs:
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-name: ${{ env.REGISTRY }}/${{ env.REPO_OWNER}}/${{ matrix.image }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

0 comments on commit eea0592

Please sign in to comment.