Skip to content

Merge pull request #23 from YKhm20020/ticket-22 #17

Merge pull request #23 from YKhm20020/ticket-22

Merge pull request #23 from YKhm20020/ticket-22 #17

Workflow file for this run

name: Deploy to Google Cloud Run
on:
push:
branches:
- main
# 下記は適宜書き換えてください
env:
GCP_PROJECT_ID: tacktail
GCP_REGION: asia-northeast1
IMAGE_NAME: gcr.io/tacktail/tacktail-backend
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Authenticate with Google Cloud
uses: google-github-actions/auth@v0.4.0
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Configure Docker
run: gcloud auth configure-docker
- name: Build and push Docker image
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
docker build -t ${IMAGE_NAME}:${TAG} .
docker push ${IMAGE_NAME}:${TAG}
- name: Deploy to Cloud Run
run: |
TAG=$(echo $GITHUB_SHA | head -c7)
gcloud run deploy tacktail-backend \
--image ${IMAGE_NAME}:${TAG} \
--platform managed \
--region ${GCP_REGION} \
--allow-unauthenticated