Skip to content

move firebase init

move firebase init #92

Workflow file for this run

name: Build and Deploy to Cloud Run
on:
push:
branches:
- main
env:
PROJECT_ID: ${{ secrets.GCP_PROJECT }}
SERVICE: ropescore-api
REGION: europe-west1
jobs:
setup-build-publish-deploy:
name: Setup, Build, Publish, and Deploy
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker BuildX as docker build
uses: docker/setup-buildx-action@v2
with:
install: true
# Setup gcloud CLI
- uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT }}
project_id: ${{ secrets.GCP_PROJECT }}
export_default_credentials: true
# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- name: Login to Google Artifact Registry
run: gcloud auth configure-docker europe-west1-docker.pkg.dev
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and Push the Docker image
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: |
europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/eu-artifacts/${{ env.SERVICE }}:latest
europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/eu-artifacts/${{ env.SERVICE }}:${{ github.sha }}
context: .
# platforms: linux/amd64,linux/arm64,linux/arm/v7
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/ropescore/api:buildcache
cache-to: type=registry,ref=ghcr.io/ropescore/api:buildcache,mode=max
- name: Deploy to Cloud Run
id: deploy
uses: google-github-actions/[email protected]
with:
service: ${{ env.SERVICE }}
image: europe-west1-docker.pkg.dev/${{ env.PROJECT_ID }}/eu-artifacts/${{ env.SERVICE }}:${{ github.sha }}
region: ${{ env.REGION }}
env_vars: SENTRY_DSN=${{ secrets.SENTRY_DSN }},GCP_PROJECT=${{ secrets.GCP_PROJECT }},FIREBASE_DATABASE_URL=${{ secrets.FIREBASE_DATABASE_URL }},SECRET_NAME=${{ secrets.SECRET_NAME }}
flags: --max-instances=3 --concurrency=160 --service-account=${{ secrets.CLOUD_RUN_SERVICE_ACCOUNT }} --remove-env-vars=JWT_ALG,JWT_PRIVKEY_PATH,JWT_PUBKEY_PATH --clear-secrets
- name: Show Output
run: echo ${{ steps.deploy.outputs.url }}