diff --git a/.github/workflows/_deployment.yml b/.github/workflows/_deployment.yml index 3e2e2f4..4c3579c 100644 --- a/.github/workflows/_deployment.yml +++ b/.github/workflows/_deployment.yml @@ -6,11 +6,7 @@ on: environment: type: string required: true - description: Name of the target environment. - ref: - type: string - required: true - description: The tag or SHA to checkout. + description: Name of the target environment. jobs: deploy: @@ -24,7 +20,15 @@ jobs: uses: google-github-actions/auth@v2 with: credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON }} - + + - name: Docker Auth + id: docker-auth + uses: 'docker/login-action@v1' + with: + username: 'oauth2accesstoken' + password: '${{ steps.auth.outputs.access_token }}' + registry: '${{ vars.REGION }}-docker.pkg.dev' + - name: Build, tag and push container id: build-image uses: docker/build-push-action@v5 @@ -32,7 +36,7 @@ jobs: context: . push: true tags: | - ${{ vars.REGION }}-docker.pkg.dev/${{ vars.GCP_PROJECT_ID }}/${{ vars.ARTIFACT_REPO }}/${{ vars.SERVICE_NAME }}:${{ inputs.ref }} + ${{ vars.REGION }}-docker.pkg.dev/${{ vars.GCP_PROJECT_ID }}/${{ vars.ARTIFACT_REPO }}/${{ vars.SERVICE_NAME }}:latest - name: Create Service declaration run: |- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e42cbad..6619c35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,5 +13,4 @@ jobs: contents: read with: environment: prod - ref: ${{ github.sha }} secrets: inherit \ No newline at end of file