Skip to content

Implementing multi tenancy #10

Implementing multi tenancy

Implementing multi tenancy #10

name: Deploy to Firebase Hosting on PR
on: pull_request
permissions:
checks: write
contents: read
pull-requests: write
jobs:
build:
name: Build
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
cache-dependency-path: |
hosting/package-lock.json
- name: Install global NPM tools
run: |
npm install -g firebase-tools@latest
- name: Cache hosting build
uses: actions/cache@v4
id: cache-hosting
with:
key: ${CI_COMMIT_REF_SLUG}
path: |
./hosting/node_modules/
./hosting/.next/cache/
- name: Build application
run: npm ci && npm install && npm run build
working-directory: ./hosting
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: hosting
path: ./hosting/.next/
retention-days: 2
deploy:
name: Deploy preview
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: "npm"
cache-dependency-path: |
hosting/package-lock.json
- name: Install global NPM tools
run: |
npm install -g firebase-tools@latest
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: hosting
- uses: FirebaseExtended/action-hosting-deploy@v0
env:
FIREBASE_CLI_EXPERIMENTS: webframeworks
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TANAM_TESTING }}
projectId: tanam-testing
expires: 7d