Skip to content

Merge pull request #2598 from build-5/master-to-dev #354

Merge pull request #2598 from build-5/master-to-dev

Merge pull request #2598 from build-5/master-to-dev #354

name: Action | Deploy to WEN
on:
push:
branches:
- develop
jobs:
deploy_api:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_SOONAVERSE_TEST }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'Use gcloud CLI'
run: 'gcloud info'
- name: Install dependencies
run: npm install
- name: Build Instance
run: npm run build:api
- name: Deploy Instance
run: |
cd packages/api
npm run deploy:prod
deploy_functions:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Set env vars
working-directory: packages/functions
run: echo "$FUNCTIONS_ENV_VARS" >> .env
env:
FUNCTIONS_ENV_VARS: ${{ secrets.FUNCTIONS_ENV_VARS_TEST }}
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only functions,firestore:indexes -P soonaverse-test -f
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
roll-firestore:
runs-on: ubuntu-latest
environment: staging
timeout-minutes: 360
needs: [deploy_functions]
defaults:
run:
working-directory: packages/database
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '10'
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: |
npm i -g ts-node
cd ../../ && npm run build:database
- name: Set env vars
run: echo "$FUNCTIONS_ENV_VARS" >> .env
env:
FUNCTIONS_ENV_VARS: ${{ secrets.FUNCTIONS_ENV_VARS_TEST }}
- name: Create serviceAccountKey.json
run: echo "$SERVICE_ACCOUNT" >> scripts/serviceAccountKey.json
env:
SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SOONAVERSE_TEST }}
- name: Roll firestore
run: cd scripts && ts-node db.upgrade.ts