File tree Expand file tree Collapse file tree 2 files changed +8
-31
lines changed Expand file tree Collapse file tree 2 files changed +8
-31
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ jobs:
171
171
- name : Upload demo-dist folder
172
172
uses : actions/upload-artifact@v3
173
173
with :
174
- name : demo-dist
174
+ name : github-pages
175
175
path : ./demo-dist
176
176
177
177
buildRelease :
Original file line number Diff line number Diff line change 9
9
uses : ./.github/workflows/ci.yml
10
10
11
11
deploy-to-gh-pages :
12
- name : Deploy to `npm` branch
12
+ name : Deploy to GitHub Pages
13
13
needs : ci
14
14
if : github.ref == 'refs/heads/main'
15
15
environment :
16
16
name : github-pages
17
- url : ${{ github.server_url }}/${{ github.repository }}/tree/gh-pages
17
+ url : ${{ steps.deployment.outputs.page_url }}
18
18
runs-on : ubuntu-latest
19
19
permissions :
20
- contents : read # for actions/checkout
20
+ pages : write # for actions/deploy-pages
21
+ id-token : write # for actions/deploy-pages
21
22
steps :
22
- - name : Checkout `gh-pages` branch
23
- uses : actions/checkout@v3
24
- with :
25
- ref : gh-pages
26
-
27
- - name : Remove existing files first
28
- run : git rm -r .
29
-
30
- - uses : actions/download-artifact@v3
31
- with :
32
- name : demo-dist
33
-
34
- - name : Publish target branch
35
- run : |
36
- git add -A
37
- if git diff --staged --quiet; then
38
- echo 'Nothing to publish'
39
- else
40
- git config user.name 'GitHub Action Script'
41
- git config user.email '[email protected] '
42
-
43
- git commit -a -m "$COMMIT_MESSAGE"
44
- git push
45
- echo 'Pushed'
46
- fi
47
- env :
48
- COMMIT_MESSAGE : ' Deploy ${{github.event.workflow_run.head_sha}} to `gh_pages` branch'
23
+ - name : Deploy to GitHub Pages
24
+ id : deployment
25
+ uses : actions/deploy-pages@v2
You can’t perform that action at this time.
0 commit comments