-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20a469c
commit a5a77e9
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Deploy to Cloud Run | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'release' | ||
|
||
|
||
env: | ||
PROJECT_ID: '${{ secrets.PROJECT_ID }}' # TODO: update Google Cloud project id. | ||
GAR_LOCATION: '${{ secrets.GAR_LOCATION }}' # TODO: update Artifact Registry location | ||
|
||
jobs: # Deployment please don't modify anything here as the infrastructure is controlled by terraform any changes here please agree with chris and reuben. | ||
# catchsha: | ||
# uses: HDRUK/gateway-web/.github/workflows/dev_deployment.yaml@dev | ||
|
||
deploy: | ||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
runs-on: ubuntu-latest | ||
environment: legacy-uat | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: GAT-1887-UAT | ||
|
||
- name: Google Auth | ||
id: auth | ||
uses: 'google-github-actions/auth@v0' | ||
with: | ||
token_format: 'access_token' | ||
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' | ||
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' | ||
|
||
- name: Read VERSION file | ||
id: getversion | ||
run: echo "::set-output name=version::$(cat Chart.yaml)" | ||
|
||
# - name: Get SHA | ||
# id: getsha | ||
# run: echo ${{ needs.catchsha.outputs.GITHUB_SHA }} | ||
|
||
- name: Deploy to Cloud Run | ||
uses: actions-hub/gcloud@master | ||
id: deploy | ||
env: | ||
PROJECT_ID: ${{ secrets.PROJECT_ID }} | ||
DEV_PROJECT_ID: ${{ secrets.DEV_PROJECT_ID }} | ||
GAR_LOCATION: ${{ secrets.GAR_LOCATION }} | ||
GAR_NAME: ${{ secrets.GAR_NAME_WEB }} | ||
SERVICE_NAME: '${{ secrets.SERVICE_NAME_WEB }}' | ||
SERVICE_REGION: '${{ secrets.SERVICE_REGION_WEB }}' | ||
|
||
with: | ||
# args: run services update '${{ env.SERVICE_NAME }}' --image='${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.DEV_PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:{{ steps.catchsha.outputs.GITHUB_SHA}} --region='${{ env.SERVICE_REGION }}' --project='${{ env.PROJECT_ID }}' | ||
# Functionality not supported by Github Actions one to ccheck back agin in the future | ||
args: run services update '${{ env.SERVICE_NAME }}' --image='${{ env.GAR_LOCATION }}'-docker.pkg.dev/'${{ env.DEV_PROJECT_ID }}'/'${{ env.GAR_NAME }}'/${{ steps.getversion.outputs.version }}:latest --region='${{ env.SERVICE_REGION }}' --project='${{ env.PROJECT_ID }}' |