Merge pull request #28 from canisterism/layouts #18
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 to Cloud Run | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to Google Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: asia-northeast1-docker.pkg.dev | |
username: _json_key | |
password: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_PRD }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: ./backend | |
platforms: linux/amd64 | |
tags: asia-northeast1-docker.pkg.dev/clip-games/cloud-run-source/application:latest | |
push: true | |
- name: "auth service account" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GCP_SERVICE_ACCOUNT_KEY_PRD }}" | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: Deploy to Cloud Run | |
run: | | |
gcloud run deploy applicaiton \ | |
--image asia-northeast1-docker.pkg.dev/clip-games/cloud-run-source/application:latest \ | |
--platform managed \ | |
--region asia-northeast1 \ | |
--allow-unauthenticated \ | |
--set-env-vars RAILS_MASTER_KEY=$(gcloud secrets versions access latest --secret="production-key") \ | |
--set-env-vars RAILS_ENV=production |