Skip to content

chore: fix docs link #50

chore: fix docs link

chore: fix docs link #50

name: 'Build (Frontend)'
on:
push:
branches:
- development
- production
paths:
- '.github/workflows/build-frontend.yaml'
- 'package.json'
- 'shared/ts/**'
- 'frontend/**'
env:
SERVICE_NAME: frontend
FILE_PATH: ./docker/Dockerfile.frontend
DISCORD_INVITE_URL: https://discord.gg/BzH7TQVVYy
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
environment: ${{ github.ref_name }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
token_format: access_token
workload_identity_provider: projects/${{vars.GCP_PROJECT_NUMBER}}/locations/global/workloadIdentityPools/${{vars.GCP_WORKLOAD_IDENTITY_POOL}}/providers/${{vars.GCP_OIDC_PROVIDER_NAME}}
service_account: ${{vars.GCP_SERVICE_ACCOUNT_NAME}}@${{vars.GCP_PROJECT_ID}}.iam.gserviceaccount.com
- name: Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: ${{vars.GCP_REGION}}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: ${{env.FILE_PATH}}
build-args: |
BACKEND_URL=${{vars.BACKEND_URL}}
BUILD_TARGET=${{env.SERVICE_NAME}}
DISCORD_INVITE_URL=${{env.DISCORD_INVITE_URL}}
FIREBASE_API_KEY=${{secrets.FIREBASE_API_KEY}}
FIREBASE_APP_ID=${{vars.FIREBASE_APP_ID}}
FIREBASE_AUTH_DOMAIN=${{vars.FIREBASE_AUTH_DOMAIN}}
FIREBASE_MEASUREMENT_ID=${{vars.FIREBASE_MEASUREMENT_ID}}
FIREBASE_MESSAGE_SENDER_ID=${{vars.FIREBASE_MESSAGING_SENDER_ID}}
FIREBASE_MICROSOFT_TENANT_ID=${{vars.FIREBASE_MICROSOFT_TENANT_ID}}
FIREBASE_PROJECT_ID=${{vars.GCP_PROJECT_ID}}
FIREBASE_STORAGE_BUCKET=${{vars.FIREBASE_STORAGE_BUCKET}}
FRONTEND_HOST=${{vars.FRONTEND_HOST}}
SCHEDULE_MEETING_URL=${{vars.SCHEDULE_MEETING_URL}}
SEGMENT_WRITE_KEY=${{secrets.SEGMENT_WRITE_KEY}}
SERVICE_NAME=${{env.SERVICE_NAME}}
tags: |
${{vars.GCP_REGION}}-docker.pkg.dev/${{vars.GCP_PROJECT_ID}}/basemind/${{env.SERVICE_NAME}}:latest
${{vars.GCP_REGION}}-docker.pkg.dev/${{vars.GCP_PROJECT_ID}}/basemind/${{env.SERVICE_NAME}}:${{github.sha}}