Skip to content

Commit

Permalink
Merge pull request #141 from chasinandrew/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
chasinandrew authored Oct 5, 2023
2 parents 7382d50 + 851752c commit e300fed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deployment-prod-canary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ on:
required: true
default: '10'
description: New Cloud Run revision traffic percentage
options:
options:
- 0
- 10
- 25
- 50
Expand All @@ -26,7 +27,8 @@ on:
required: true
default: '90'
description: Old Cloud Run revision traffic percentage
options:
options:
- 0
- 10
- 25
- 50
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/deployment-prod-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
release:
types: [published]
jobs:
image-build-push:
name: "Image Build & Push"
image-tag:
name: "Image tag to latest"
runs-on: ubuntu-latest
environment: prod
permissions:
Expand All @@ -21,33 +21,14 @@ jobs:
token_format: 'access_token'
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected]

# Authenticate Docker to Google Cloud Artifact Registry
- name: Docker Authentication
id: docker-auth
uses: 'docker/login-action@v1'
with:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: '${{ vars.region }}-docker.pkg.dev'
#TODO: ONLY tag, don't build
- name: Build and Tag
id: build-image
uses: docker/build-push-action@v3
with:
context: ${{ vars.code_directory }}
push: true
tags: |
${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:${{ github.event.release.tag_name }}
${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:latest

#TODO: ONLY tag, don't build
- name: Docker Push
- name: tag
shell: bash
run: |-
docker push "${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:${{ github.event.release.tag_name }}"
docker push "${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:latest"
gcloud artifacts docker tags add \
"${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:latest" \
"${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:${{ github.event.release.tag_name }}"
deploy-prod:
if: contains(fromJSON('["main"]'), github.ref_name) && ${{ inputs.environment }} == "prod"
name: "Cloud Run Deployment"
Expand Down

0 comments on commit e300fed

Please sign in to comment.