diff --git a/.github/workflows/deploy-container-image.yml b/.github/workflows/deploy-container-image.yml index 4dbd5c802..c34417194 100644 --- a/.github/workflows/deploy-container-image.yml +++ b/.github/workflows/deploy-container-image.yml @@ -1,31 +1,25 @@ -name: Deploy container image to GitHub Packages +name: Publish Docker image on: - # Trigger the workflow every time you push to the `main` branch - # Using a different branch name? Replace `main` with your branch’s name - push: - branches: [ main ] - # Allows you to run this workflow manually from the Actions tab on GitHub. - workflow_dispatch: - -# Allow this job to clone the repo and create a page deployment -permissions: - contents: read - pages: write - id-token: write + release: + types: [published] env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - FORMSPREE: ${{ secrets.FORMSPREE }} + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + FORMSPREE: ${{ secrets.FORMSPREE }} jobs: build: + name: Push Docker image to multiple registries runs-on: ubuntu-latest + permissions: + packages: write + contents: read steps: - name: Checkout your repository using git uses: actions/checkout@v4 - + - name: Install Tools & Dependencies uses: ./.github/actions/install @@ -41,23 +35,23 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 with: - images: | - n4t5u/${{ env.IMAGE_NAME }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - + images: | + n4t5u/${{ env.IMAGE_NAME }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build the container image run: pnpm run build # build:docker - name: Build and push Docker image uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: - context: . - file: ./Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}