Skip to content

Commit

Permalink
login to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuanianji committed Jan 7, 2024
1 parent 9b86320 commit 04e5ea8
Showing 2 changed files with 11 additions and 8 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/_deployment.yml
Original file line number Diff line number Diff line change
@@ -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,15 +20,23 @@ jobs:
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON }}


- name: Docker Auth
id: docker-auth
uses: 'docker/#-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
with:
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: |-
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -13,5 +13,4 @@ jobs:
contents: read
with:
environment: prod
ref: ${{ github.sha }}
secrets: inherit

0 comments on commit 04e5ea8

Please # to comment.