Skip to content

Commit

Permalink
Merge pull request #10 from ranger-ross/ross-dev-1
Browse files Browse the repository at this point in the history
Added automated deployment with Github actions
  • Loading branch information
ranger-ross authored Dec 5, 2021
2 parents 83a3189 + cbe79ae commit 2bb45fc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,26 @@ jobs:

- name: Tag image
run: gcloud artifacts docker tags add ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$GITHUB_REF_NAME


Deploy-To-Cloud-Run:
needs: [Retag-Image]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v0.2.1
with:
project_id: nihongo-stats

- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v0.4.1
with:
credentials_json: ${{ secrets.DEPLOY_SERVICE_ACCOUNT_KEY }}

- name: Deploy to Cloud Run
run: gcloud run deploy nihongo-stats --region us-central1 --image ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$GITHUB_REF_NAME

0 comments on commit 2bb45fc

Please sign in to comment.