Skip to content

Merge pull request #107 from CodeLog-Development/deps/yarn-lock #10

Merge pull request #107 from CodeLog-Development/deps/yarn-lock

Merge pull request #107 from CodeLog-Development/deps/yarn-lock #10

name: Build and Deploy
on:
push:
branches:
- main
env:
PROJECT_ID: qubetime
REGION: europe-west4
GAR_LOCATION: europe-west4-docker.pkg.dev/qubetime/qubetime-ng-universal/qubetime
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build_and_deploy:
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_SERVICE_ACCOUNT }}'
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Docker auth
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- name: Build frontend Docker container
run: yarn nx container webapp
- run: docker tag webapp:main ${{ env.GAR_LOCATION }}
- run: docker push ${{ env.GAR_LOCATION }}
- id: deploy
uses: 'google-github-actions/deploy-cloudrun@v2'
with:
service: 'qubetime'
image: '${{ env.REGION }}-docker.pkg.dev/qubetime/qubetime-ng-universal/qubetime:latest'
region: ${{ env.REGION }}
- name: Build API
run: yarn nx run uncube-api:build:production
- name: Deploy API
run: yarn firebase deploy --only functions
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}