Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/mirzaazwad/TaxWizard into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NafisaMaliyat-iut committed Nov 3, 2023
2 parents 8fdc234 + 3292dea commit 9551541
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
59 changes: 59 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Deploy to Cloud Run

on:
workflow_run:
workflows: "Continuous Integration"
types:
- completed

env:
PROJECT_ID: tax-worker
GAR_LOCATION: us-west1
SERVICE: tax-worker
REGION: us-west1

jobs:
deploy:

permissions:
contents: 'read'
id-token: 'write'

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- 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: Docker Auth
id: docker-auth
uses: 'docker/login-action@v1'
with:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: '${{ env.GAR_LOCATION }}-docker.pkg.dev'

- name: Build and Push Container
run: |-
docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}" ./
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}"
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ env.SERVICE }}
region: ${{ env.REGION }}
image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }}

- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}
6 changes: 5 additions & 1 deletion .github/workflows/main.cd.yml → main.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ on:
env:
PROJECT_ID: tax-worker
GAR_LOCATION: us-west1
SERVICE: taxwizard-00001-qx5
SERVICE: tax-worker
REGION: us-west1

jobs:
on-success:
permissions:
contents: 'read'
id-token: 'write'

runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
Expand Down

0 comments on commit 9551541

Please sign in to comment.