@@ -2,48 +2,60 @@ name: Surge.sh Preview
22
33on :
44 workflow_run :
5- workflows : ["Build Website"]
5+ workflows : [ "Build Website" ]
66 types :
77 - completed
88
9+ defaults :
10+ run :
11+ shell : bash
12+
913jobs :
1014 preview :
1115 runs-on : ubuntu-latest
12- if : github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
16+ if : |
17+ github.event.workflow_run.event == 'pull_request' &&
18+ github.event.workflow_run.conclusion == 'success' &&
19+ github.event.workflow_run.name == 'Build Website'
20+ permissions :
21+ actions : read
22+ pull-requests : write
1323 steps :
1424 - name : Download PR Artifact
15- uses : dawidd6/action- download-artifact@v20
25+ uses : actions/ download-artifact@v8
1626 with :
17- workflow : ${{ github.event.workflow_run.workflow_id }}
18- workflow_conclusion : success
1927 name : site
28+ github-token : ${{ secrets.GITHUB_TOKEN }}
29+ run-id : ${{ github.event.workflow_run.id }}
30+
2031 - name : Store PR id as variable
2132 id : pr
2233 run : |
23- echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
24- rm -f pr-id.txt
34+ echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
35+
2536 - name : Publishing to surge for preview
2637 id : deploy
27- run : npx surge ./ --domain https://quarkus-openapi-generator-preview-pr-${{ steps.pr.outputs.id }}.surge.sh --token ${{ secrets.SURGE_LOCAL_TOKEN }}
38+ run : npx surge ./ --domain https://quarkiverse-openapi-generator-preview-pr-${{ steps.pr.outputs.id }}.surge.sh --token ${{ secrets.SURGE_TOKEN }}
39+
2840 - name : Update PR status comment on success
29- uses : actions-cool/maintain-one-comment@v3.2.0
41+ uses : quarkusio/action-helpers@main
3042 with :
31- token : ${{ secrets.GITHUB_TOKEN }}
43+ action : maintain-one-comment
44+ github-token : ${{ secrets.GITHUB_TOKEN }}
45+ pr-number : ${{ steps.pr.outputs.id }}
3246 body : |
33- 🎊 PR Preview ${{ github.sha }} has been successfully built and deployed. See the documentation preview: https://quarkus-openapi-generator-preview-pr-${{ steps.pr.outputs.id }}.surge.sh
34- <!-- Sticky Pull Request Comment -->
35- body-include : ' <!-- Sticky Pull Request Comment -->'
36- number : ${{ steps.pr.outputs.id }}
37- emojis : ' heart'
47+ 🚀 PR Preview ${{ github.sha }} has been successfully built and deployed to https://quarkiverse-openapi-generator-preview-pr-${{ steps.pr.outputs.id }}.surge.sh
48+
49+ <img width="300" src="https://user-images.githubusercontent.com/507615/90250366-88233900-de6e-11ea-95a5-84f0762ffd39.png">
50+ body-marker : <!-- Preview status comment marker -->
3851 - name : Update PR status comment on failure
52+ uses : quarkusio/action-helpers@main
3953 if : ${{ failure() }}
40- uses : actions-cool/maintain-one-comment@v3.2.0
4154 with :
42- token : ${{ secrets.GITHUB_TOKEN }}
55+ action : maintain-one-comment
56+ github-token : ${{ secrets.GITHUB_TOKEN }}
57+ pr-number : ${{ steps.pr.outputs.id }}
4358 body : |
4459 😭 Deploy PR Preview failed.
4560 <img width="300" src="https://user-images.githubusercontent.com/507615/90250824-4e066700-de6f-11ea-8230-600ecc3d6a6b.png">
46- <!-- Sticky Pull Request Comment -->
47- body-include : ' <!-- Sticky Pull Request Comment -->'
48- number : ${{ steps.pr.outputs.id }}
49- emojis : ' confused'
61+ body-marker : <!-- Preview status comment marker -->
0 commit comments