fix: Dockerfile の CMD の文法が間違っていたので修正 #8
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 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 |