Skip to content

Commit da00633

Browse files
authored
Use new native GitHub Pages deployment
1 parent 1663cd9 commit da00633

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.github/workflows/demo.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
1+
# From https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/
12
name: Demo
23

34
on:
45
- pull_request
56
- push
67

8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow one concurrent deployment
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: true
18+
719
jobs:
8-
deploy:
20+
build:
921
runs-on: ubuntu-latest
1022
steps:
1123
- uses: actions/checkout@v3
12-
- run: npm install
24+
- run: npm ci
1325
- run: npm run demo:build
1426
- run: npm run demo:test
15-
- uses: peaceiris/actions-gh-pages@v3
16-
if: github.ref == 'refs/heads/main'
17-
with:
18-
github_token: ${{ secrets.GITHUB_TOKEN }}
19-
publish_dir: ./demo/dist
20-
user_name: 'github-actions[bot]'
21-
user_email: 'github-actions[bot]@users.noreply.github.com'
27+
- name: Upload artifact
28+
uses: actions/upload-pages-artifact@v1
29+
30+
deploy:
31+
environment:
32+
name: github-pages
33+
url: ${{ steps.deployment.outputs.page_url }}
34+
runs-on: ubuntu-latest
35+
needs: build
36+
if: github.ref == 'refs/heads/main'
37+
steps:
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)