gcloud #80
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 | |
on: | |
push: | |
branches: | |
- gcp | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: 'actions/checkout@v4' | |
- name: Prepare environment | |
env: | |
Dotenv: ${{ secrets.DOTENV_ME }} | |
run: | | |
echo "DOTENV_ME=$Dotenv" > .env.me | |
npm install | |
npx dotenv-vault pull | |
npx dotenv-vault pull production | |
npx ts-node scripts/merge-envs.ts | |
npm run build | |
- uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS_JSON }}' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v2' | |
with: | |
version: '>= 363.0.0' | |
- name: 'build' | |
run: | | |
gcloud builds submit --config cloudbuild.yaml . | |
- name: 'run' | |
run: gcloud run deploy crew --image europe-west1-docker.pkg.dev/gmail-reminder-api/cloud-run-source-deploy/crew:latest --env-vars-file ./.env.json --region europe-west1 --allow-unauthenticated |