Skip to content

Deploy to Firebase Hosting on PR #33

Deploy to Firebase Hosting on PR

Deploy to Firebase Hosting on PR #33

name: Deploy to Firebase Hosting on PR
on:
workflow_run:
workflows: ['PR Check']
types: [completed]
branches: [main, develop]
concurrency:
group: firebase-preview-${{ github.event.workflow_run.pull_requests[0].number || github.run_id }}
cancel-in-progress: true
permissions:
checks: write
contents: read
pull-requests: write
actions: read
jobs:
deploy_preview:
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.pull_requests[0] != null &&
github.event.workflow_run.head_repository.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: pr-check.yml
run_id: ${{ github.event.workflow_run.id }}
name: build-${{ github.event.workflow_run.pull_requests[0].number }}
path: dist
- name: Deploy Preview to Firebase
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_TTORANG }}
projectId: ttorang
env:
GITHUB_PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}