Skip to content

Commit 819cd04

Browse files
committed
feat: 更新发布脚本
1 parent 145cd11 commit 819cd04

1 file changed

Lines changed: 9 additions & 43 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 9 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
name: Deploy MkDocs to Custom Domain
1+
name: Deploy MkDocs to GitHub Pages
22

33
on:
44
push:
55
branches: [ main, master ]
6-
pull_request:
7-
branches: [ main, master ]
86

97
permissions:
10-
contents: read
11-
pages: write
12-
id-token: write
13-
14-
concurrency:
15-
group: "pages"
16-
cancel-in-progress: false
8+
contents: write
179

1810
jobs:
19-
build:
11+
deploy:
2012
runs-on: ubuntu-latest
2113
steps:
2214
- name: Checkout
@@ -27,40 +19,14 @@ jobs:
2719
- name: Setup Python
2820
uses: actions/setup-python@v4
2921
with:
30-
python-version: '3.11'
31-
32-
- name: Cache dependencies
33-
uses: actions/cache@v3
34-
with:
35-
path: ~/.cache/pip
36-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
37-
restore-keys: |
38-
${{ runner.os }}-pip-
22+
python-version: '3.x'
3923

4024
- name: Install dependencies
4125
run: |
42-
python -m pip install --upgrade pip
4326
pip install -r requirements.txt
4427
45-
- name: Build MkDocs
46-
run: mkdocs build --strict
47-
48-
- name: Add CNAME file for custom domain
49-
run: echo "studygit.webtech.wiki" > ./site/CNAME
50-
51-
- name: Upload artifact
52-
uses: actions/upload-pages-artifact@v2
53-
with:
54-
path: ./site
55-
56-
deploy:
57-
environment:
58-
name: github-pages
59-
url: ${{ steps.deployment.outputs.page_url }}
60-
runs-on: ubuntu-latest
61-
needs: build
62-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
63-
steps:
64-
- name: Deploy to GitHub Pages
65-
id: deployment
66-
uses: actions/deploy-pages@v2
28+
- name: Deploy to gh-pages
29+
run: |
30+
git config --global user.name 'github-actions[bot]'
31+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
32+
mkdocs gh-deploy --force

0 commit comments

Comments
 (0)