@@ -22,50 +22,19 @@ permissions:
22
22
23
23
env :
24
24
BUILD_DIR : build/dist/bin/adev/build/browser
25
+ PREVIEW_PROJECT : angular-ja
25
26
26
27
jobs :
27
28
deploy :
28
29
runs-on : ubuntu-latest
29
30
if : ${{ github.event.workflow_run.conclusion == 'success' }}
30
31
steps :
31
32
- uses : actions/checkout@v4
32
- - name : Download adev preview artifact from previous workflow run
33
- uses : actions/download-artifact@v4
33
+ - uses : angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@53fb7c37cf14343f14ed79e2fefbbb2489ead4ee
34
34
with :
35
- name : adev-preview
36
- path : ${{ env.BUILD_DIR }}
37
35
github-token : ' ${{secrets.GITHUB_TOKEN}}'
38
- run-id : ${{ github.event.workflow_run.id }}
39
- - name : Extract pull request number
40
- id : pr-number
41
- run : |
42
- PR_NUMBER=$(cat ./$BUILD_DIR/__metadata__pull_number.txt)
43
- echo 'value=$PR_NUMBER' >> $GITHUB_OUTPUT
44
- - name : Deploy to Firebase Hosting Preview
45
- id : firebase-deploy
46
- uses :
FirebaseExtended/[email protected]
47
- with :
48
- repoToken : " ${{ secrets.GITHUB_TOKEN }}"
49
- firebaseServiceAccount : " ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
50
- projectId : angular-ja
51
- channelId : pr-${{ steps.pr-number.outputs.value }}
52
- expires : 7d
53
- disableComment : true
54
- - name : Find Comment
55
- uses : peter-evans/find-comment@v3
56
- id : find-comment
57
- with :
58
- token : ${{ secrets.GITHUB_TOKEN }}
59
- issue-number : ${{ steps.pr-number.outputs.value }}
60
- comment-author : ' github-actions[bot]'
61
- body-includes : ' Preview deployed'
62
- - name : Comment on pull request
63
- uses : peter-evans/create-or-update-comment@v4
64
- with :
65
- token : ${{ secrets.GITHUB_TOKEN }}
66
- issue-number : ${{ steps.pr-number.outputs.value }}
67
- comment-id : ${{ steps.find-comment.outputs.comment-id }}
68
- edit-mode : replace
69
- body : |
70
- Preview deployed: ${{ steps.firebase-deploy.outputs.details_url }} (commit: ${{ github.event.workflow_run.head_sha }})
71
-
36
+ workflow-artifact-name : ' adev-preview'
37
+ firebase-config-dir : ' ./'
38
+ firebase-public-dir : ' ./adev/build/browser'
39
+ firebase-project-id : ' ${{env.PREVIEW_PROJECT}}'
40
+ firebase-service-key : ' ${{secrets.FIREBASE_SERVICE_ACCOUNT}}'
0 commit comments