From cbe79aeb8f3852e55257b59345f285b3ab3dcbfe Mon Sep 17 00:00:00 2001 From: Ross Sullivan Date: Sun, 5 Dec 2021 13:16:26 -0600 Subject: [PATCH] Added automated deployment with Github actions --- .github/workflows/deploy.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 992442d1..4811ad28 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 \ No newline at end of file