-
-
Save brunosabot/a28b8dd9c7090b66a98427fe56d26047 to your computer and use it in GitHub Desktop.
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
name: Deploy the application to Google Cloud Run | |
on: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
deploy: | |
name: Deploy job | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v1 | |
- name: Build Docker image | |
run: | | |
docker build . --tag eu.gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} | |
- name: Authenticate into Google Cloud Platform | |
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | |
with: | |
service_account_email: ${{ secrets.GCLOUD_EMAIL }} | |
service_account_key: ${{ secrets.GCLOUD_AUTH }} | |
- name: Configure Docker to use Google Cloud Platform | |
run: "gcloud auth configure-docker --quiet" | |
- name: Push image to Google Cloud Container Registry | |
run: docker push eu.gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} | |
- name: Install beta commands and deploy on cloud run | |
run: | | |
gcloud components install beta --quiet | |
gcloud beta run deploy ${{ secrets.GCLOUD_APP_NAME }} --quiet --image eu.gcr.io/${{ secrets.GCLOUD_PROJECT }}/${{ secrets.GCLOUD_APP_NAME }} --project ${{ secrets.GCLOUD_PROJECT }} --region europe-west1 --platform managed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you explain what
secrets.GCLOUD_AUTH
is? I imagine thesecrets.GCLOUD_EMAIL
is the service account email, but I dont know what the auth is. Is is the service account keyfile.json contents? Or is it some sort of password?