-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirebase-hosting-pull-request.yml
More file actions
44 lines (38 loc) · 1.3 KB
/
firebase-hosting-pull-request.yml
File metadata and controls
44 lines (38 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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 }}