Skip to content

✅ deployFix: #28 チャンネルIDを変更 #42

✅ deployFix: #28 チャンネルIDを変更

✅ deployFix: #28 チャンネルIDを変更 #42

Workflow file for this run

name: Deploy to Cloud Run
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
env:
SERVICE_NAME: 'yuru-sprint'
REGION: 'asia-northeast1'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
service_account: ${{ secrets.SA_EMAIL }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ secrets.PROJECT_ID }}
install_components: 'beta'
- name: Create .env file
run: echo "${{ secrets.ENV_FILE }}" > .env
- name: Build Docker image
run: |
docker build --no-cache --build-arg NODE_ENV=production -t gcr.io/${{ secrets.PROJECT_ID }}/${{ env.SERVICE_NAME }}:$GITHUB_SHA .
- name: Push Docker image
run: |
gcloud auth configure-docker
docker push gcr.io/${{ secrets.PROJECT_ID }}/${{ env.SERVICE_NAME }}:$GITHUB_SHA
- name: Deploy to Cloud Run
run: |
export $(grep -v '^#' .env | xargs) && \
gcloud run deploy ${{ env.SERVICE_NAME }} \
--image gcr.io/${{ secrets.PROJECT_ID }}/${{ env.SERVICE_NAME }}:$GITHUB_SHA \
--platform managed \
--region ${{ env.REGION }} \
--allow-unauthenticated \
--set-env-vars "NODE_ENV=$NODE_ENV, WEBHOOK_URLS=$WEBHOOK_URLS, SLACK_BOT_TOKEN=$SLACK_BOT_TOKEN, CHANNEL_IDS=$CHANNEL_IDS, USER_IDS=$USER_IDS, USER_NAMES=$USER_NAMES, NOTION_INTEGRATION_TOKEN=$NOTION_INTEGRATION_TOKEN, NOTION_DATABASE_ID=$NOTION_DATABASE_ID"