From 0d6999366bfd83f0c337d6d8e6a2b9af81548c24 Mon Sep 17 00:00:00 2001 From: Gabriel Guimaraes Date: Mon, 15 Apr 2024 14:56:17 +0100 Subject: [PATCH] fix: added prems and docker login --- .github/workflows/cd.yaml | 5 +---- .github/workflows/docker.yaml | 7 +++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 687a5c2..c71348e 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -8,6 +8,7 @@ on: permissions: contents: read + packages: write jobs: release-please: @@ -63,10 +64,6 @@ jobs: - php/7.4/fpm-nginx - php/8.0/fpm-nginx - php/8.2/fpm-nginx - exclude: - - base: ${{ needs.release-please.outputs.release_created || contains(needs.orchestrator.outputs.changed-directories, 'php/7.4/fpm-nginx') && 'ignored' || 'php/7.4/fpm-nginx' }} - - base: ${{ needs.release-please.outputs.release_created || contains(needs.orchestrator.outputs.changed-directories, 'php/8.0/fpm-nginx') && 'ignored' || 'php/8.0/fpm-nginx' }} - - base: ${{ needs.release-please.outputs.release_created || contains(needs.orchestrator.outputs.changed-directories, 'php/8.2/fpm-nginx') && 'ignored' || 'php/8.2/fpm-nginx' }} uses: ./.github/workflows/docker.yaml with: version: ${{ needs.release-please.outputs.release_created && needs.release-please.outputs.tag_name || github.sha}} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 72b3e3f..92bab40 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -90,6 +90,13 @@ jobs: # for tag in $MUTABLE_TAGS; do # aws ecr batch-delete-image --repository-name $REPOSITORY --image-ids imageTag=$tag # done + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.GHCR }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build ${{ inputs.push && 'and push ' || '' }}Docker image id: build-and-push