Merge pull request #15 from oddbit/release-candidate #11
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: Upload Extension | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout code | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
cache-dependency-path: functions/yarn.lock | |
- name: Install global NPM tools | |
run: | | |
yarn global add firebase-tools@latest | |
firebase --version | |
# The variable `FIREBASE_SA` must be a base64 encoded string | |
# of the service account JSON to avoid problems with quote escaping and | |
# conversion of '\n' characters generating invalid JSON | |
- name: Set service account for Firebase CLI | |
run: | | |
echo "GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/service_account.json" >> $GITHUB_ENV | |
echo ${{ secrets.FIREBASE_SA }} | base64 -d -i - > service_account.json | |
- run: yarn --cwd functions install | |
- run: yarn --cwd functions build | |
- run: >- | |
firebase ext:dev:upload | |
--local | |
--force | |
oddbit/firebase-alerts | |
# Try to save potential log files if something went wrong | |
- name: Upload debug log | |
uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: debug-log-functions | |
path: firebase-debug.log | |
if-no-files-found: ignore |