Deploy #16
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: Deploy | |
on: | |
workflow_dispatch: | |
permissions: | |
checks: write | |
contents: read | |
pull-requests: write | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies and build | |
run: | | |
pnpm install | |
cd docs | |
pnpm install | |
cd ../api | |
npm install | |
- name: Install Firebase Tools | |
run: | | |
npm install -g firebase-tools | |
firebase experiments:enable webframeworks | |
- name: Set up Google Application Credentials | |
run: | | |
mkdir -p ./api/credentials | |
echo "$FIREBASE_CREDENTIALS" | base64 -d > ./api/credentials/cert.json | |
env: | |
FIREBASE_CREDENTIALS: ${{ secrets.FIREBASE_CREDENTIALS }} | |
- name: Setup Environment Variables | |
run: | | |
mkdir -p ./api | |
echo "$BEARER" > ./api/.env | |
env: | |
BEARER: ${{ secrets.BEARER }} | |
- name: Deploy Documentation | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
run: | | |
cd docs | |
pnpm run build | |
firebase deploy --only hosting --token $FIREBASE_TOKEN | |
- name: Deploy API | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
run: | | |
cd api | |
# firebase deploy --only functions --token $FIREBASE_TOKEN --project=steam-brew | |
- name: Deploy Main Site | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
run: | | |
pnpm run build | |
firebase deploy --only hosting --token $FIREBASE_TOKEN |