WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit a0cb667

Browse files
committed
Added github workflow for actions
1 parent 65ddaac commit a0cb667

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,47 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
816

917
jobs:
10-
deploy:
11-
name: Deploy to GitHub Pages
18+
build:
1219
runs-on: ubuntu-latest
1320
steps:
14-
- uses: actions/checkout@v4
21+
- name: Checkout
22+
uses: actions/checkout@v4
1523
with:
1624
fetch-depth: 0
17-
- uses: actions/setup-node@v4
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
1827
with:
1928
node-version: 18
2029
cache: npm
21-
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v4
2232
- name: Install dependencies
2333
run: npm ci
24-
- name: Build website
34+
- name: Build with Docusaurus
2535
run: npm run build
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: ./build
2640

41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
2748
- name: Deploy to GitHub Pages
28-
uses: peaceiris/actions-gh-pages@v3
29-
if: github.ref == 'refs/heads/main'
30-
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: ./build
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)