1.0.45 #183
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: Action | Deploy to Production | |
on: | |
release: | |
types: [published] | |
jobs: | |
deploy_functions: | |
runs-on: ubuntu-latest | |
environment: production | |
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_PROD }} | |
- name: Deploy to Firebase | |
uses: w9jds/firebase-action@master | |
with: | |
args: deploy --only functions,firestore:indexes -P soonaverse -f | |
env: | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} | |
deploy_to_npm: | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Init | |
run: | | |
npm version ${{ github.event.release.tag_name }} --workspace packages/interfaces | |
npm version ${{ github.event.release.tag_name }} --workspace packages/lib | |
npm run build:lib | |
- name: Deploy to npm | |
run: | | |
npm publish --workspace packages/interfaces | |
npm publish --workspace packages/lib | |
roll-firestore: | |
runs-on: ubuntu-latest | |
environment: production | |
timeout-minutes: 360 | |
needs: [deploy_functions] | |
defaults: | |
run: | |
working-directory: packages/functions | |
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:functions | |
- name: Set env vars | |
run: echo "$FUNCTIONS_ENV_VARS" >> .env | |
env: | |
FUNCTIONS_ENV_VARS: ${{ secrets.FUNCTIONS_ENV_VARS_PROD }} | |
- name: Create serviceAccountKey.json | |
run: echo "$SERVICE_ACCOUNT" >> scripts/serviceAccountKey.json | |
env: | |
SERVICE_ACCOUNT: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_SOONAVERSE }} | |
- name: Roll firestore | |
run: cd scripts && ts-node db.upgrade.ts |