File tree Expand file tree Collapse file tree 3 files changed +39
-53
lines changed Expand file tree Collapse file tree 3 files changed +39
-53
lines changed Original file line number Diff line number Diff line change 1+ name : Build and deploy
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+ workflow_dispatch :
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v5
13+ with :
14+ fetch-depth : 0 # get all history.
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v6
18+ with :
19+ python-version : ' 3.x'
20+
21+ - name : Install gnuplot and build
22+ run : |
23+ sudo apt-get update -y
24+ sudo apt-get install -y gnuplot
25+ pipx run nox -s build
26+
27+ - name : Deploy to Netlify
28+ uses : nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654 # v3.0.0
29+ with :
30+ publish-dir : ' test-report'
31+ production-branch : main
32+ github-token : ${{ secrets.GITHUB_TOKEN }}
33+ deploy-message : " Deploy from GitHub Actions"
34+ enable-pull-request-comment : true
35+ overwrites-pull-request-comment : true
36+ env :
37+ NETLIFY_AUTH_TOKEN : ${{ secrets.NETLIFY_AUTH_TOKEN }}
38+ NETLIFY_SITE_ID : ${{ secrets.NETLIFY_SITE_ID }}
39+ timeout-minutes : 1
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -138,30 +138,10 @@ jobs:
138138 name : test-report
139139 path : test-report
140140
141- - name : Deploy to GitHub Pages for PR
142- if : ${{ github.event_name == 'pull_request' && matrix.python-version == '3.9' }}
143- uses : peaceiris/actions-gh-pages@v4
144- with :
145- github_token : ${{ secrets.GITHUB_TOKEN }}
146- publish_dir : test-report
147- # Configure a unique preview link for each pull request
148- destination_dir : previews/${{ github.event.pull_request.number }}
149-
150141 - name : Deploy to GitHub Pages for main branch
151142 if : ${{ (github.ref_name == 'main' || github.event_name == 'workflow_dispatch') && matrix.python-version == '3.9' }}
152143 uses : peaceiris/actions-gh-pages@v4
153144 with :
154145 github_token : ${{ secrets.GITHUB_TOKEN }}
155146 publish_dir : test-report
156147 keep_files : true # do not remove example reports
157-
158- - name : Add PR Comment with Preview Link
159- if : ${{ github.event_name == 'pull_request' && matrix.python-version == '3.9' }}
160- env :
161- PR_NUMBER : ${{ github.event.pull_request.number }}
162- REPO_NAME : ${{ github.repository }}
163- GH_TOKEN : ${{ github.token }}
164- run : |
165- PREVIEW_URL="https://shenxianpeng.github.io/gitstats/previews/${{ env.PR_NUMBER }}/index.html"
166- COMMENT_BODY="🎉 Your GitStats preview is ready: [View Report](${PREVIEW_URL})"
167- gh api repos/${{ env.REPO_NAME }}/issues/${{ env.PR_NUMBER }}/comments -f body="${COMMENT_BODY}"
You can’t perform that action at this time.
0 commit comments