Skip to content

refactor

refactor #7

Workflow file for this run

name: Deploy Firebase Function
on: push
# push:
# branches:
# - main
# workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: subosito/[email protected]
name: Set up Flutter SDK
with:
channel: 'stable'
cache: true
- uses: actions/setup-node@v2
name: Setup Node.js
with:
node-version: 18
- name: Cache Dependencies
uses: actions/cache@v3
id: cache-dependencies
with:
path: |
~/.npm
~/.cache/firebase
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Print Working Directory
run: |
echo "Working directory: $(pwd)"
echo ls -a
- name: Install Dependencies
working-directory: functions
run: |
npm ci
- name: Print Working Directory
run: |
echo "Working directory: $(pwd)"
echo ls -a
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Print Working Directory
run: |
echo "Working directory: $(pwd)"
- name: Prepare Google Application Credentials
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
run: |
echo $GOOGLE_APPLICATION_CREDENTIALS | base64 -di > functions/google-application-credentials.json
- name: Use Firebase Dev
run: |
firebase use dev --debug
- name: Deploy Firebase functions
run: firebase deploy --only functions --non-interactive --debug
- name: Remove credentials file
if: success() || failure()
run: |
rm functions/google-application-credentials.json