Feat/ci cd for api #28
Workflow file for this run
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: Build Web | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "web/**" | |
- ".github/workflows/BuildWeb.yml" | |
- "!.github/workflows/BuildApi.yml" | |
pull_request: | |
paths: | |
- "web/**" | |
- ".github/workflows/BuildWeb.yml" | |
- "!.github/workflows/BuildApi.yml" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
#permissions: | |
# contents: read | |
# pages: write | |
# id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "web" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./web | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Install dependencies | |
run: | | |
npm install | |
- name: Build Next.js App | |
run: | | |
npm run build | |
env: | |
NEXT_PUBLIC_API_KEY: ${{ secrets.WEB_API_KEY }} | |
NEXT_PUBLIC_AUTH_DOMAIN: ${{ vars.WEB_AUTH_DOMAIN }} | |
NEXT_PUBLIC_PROJECT_ID: ${{ vars.WEB_PROJECT_ID }} | |
NEXT_PUBLIC_STORAGE_BUCKET: ${{ vars.WEB_STORAGE_BUCKET }} | |
NEXT_PUBLIC_MESSAGING_SENDER_ID: ${{ vars.WEB_MESSAGING_SENDER_ID }} | |
NEXT_PUBLIC_APP_ID: ${{ secrets.WEB_APP_ID }} | |
NEXT_PUBLIC_MEASUREMENT_ID: ${{ vars.WEB_MEASUREMENT_ID }} | |
- name: Deploy | |
uses: FirebaseExtended/action-hosting-deploy@v0 | |
with: | |
repoToken: "${{ secrets.GITHUB_TOKEN }}" | |
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}" | |
projectId: "${{ secrets.WEB_PROJECT_ID }}" | |
entryPoint: "./web" | |
channelId: live | |
env: | |
FIREBASE_CLI_EXPERIMENTS: webframeworks |