|
| 1 | +name: Check Firebase Functions Deploy |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main, develop] |
| 6 | + |
| 7 | +jobs: |
| 8 | + firebase: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + defaults: |
| 11 | + run: |
| 12 | + working-directory: openci-runner/firebase/functions |
| 13 | + |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - uses: actions/setup-node@v4 |
| 18 | + with: |
| 19 | + node-version-file: .nvmrc |
| 20 | + |
| 21 | + - name: Install github-apps dependencies |
| 22 | + working-directory: openci-runner/github-apps |
| 23 | + run: npm ci |
| 24 | + |
| 25 | + - name: Build github-apps |
| 26 | + working-directory: openci-runner/github-apps |
| 27 | + run: npm run build |
| 28 | + |
| 29 | + - name: Install firebase-functions dependencies |
| 30 | + run: npm ci |
| 31 | + |
| 32 | + - name: Build firebase-functions |
| 33 | + run: npm run build |
| 34 | + |
| 35 | + - uses: google-github-actions/auth@v2 |
| 36 | + with: |
| 37 | + credentials_json: ${{ secrets.FIREBASE_SA_KEY }} |
| 38 | + |
| 39 | + - name: Install firebase tools |
| 40 | + run: npm install -g firebase-tools |
| 41 | + |
| 42 | + - name: Write emulator params |
| 43 | + working-directory: openci-runner/firebase/functions |
| 44 | + env: |
| 45 | + FB_SERVICE_ACCOUNT: ${{ secrets.FB_SERVICE_ACCOUNT }} |
| 46 | + GITHUB_PRIVATE_KEY: dummy |
| 47 | + GITHUB_WEBHOOK_SECRET: dummy |
| 48 | + GITHUB_APP_ID: 1 |
| 49 | + run: | |
| 50 | + cat <<'EOF' > .env.local |
| 51 | + FB_SERVICE_ACCOUNT=${FB_SERVICE_ACCOUNT} |
| 52 | + GITHUB_PRIVATE_KEY=${GITHUB_PRIVATE_KEY} |
| 53 | + GITHUB_WEBHOOK_SECRET=${GITHUB_WEBHOOK_SECRET} |
| 54 | + GITHUB_APP_ID=${GITHUB_APP_ID} |
| 55 | + EOF |
| 56 | +
|
| 57 | + - name: Deploy |
| 58 | + working-directory: openci-runner/firebase |
| 59 | + run: firebase emulators:exec --only functions "echo ok" |
0 commit comments