Skip to content

Instantly share code, notes, and snippets.

@brunosabot
Last active July 9, 2020 22:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brunosabot/a28b8dd9c7090b66a98427fe56d26047 to your computer and use it in GitHub Desktop.
Save brunosabot/a28b8dd9c7090b66a98427fe56d26047 to your computer and use it in GitHub Desktop.
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
@AustinGil
Copy link

Can you explain what secrets.GCLOUD_AUTH is? I imagine the secrets.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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment