Skip to content

Commit fedf1d2

Browse files
use ssh key to deploy
1 parent f7c16ee commit fedf1d2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/deploy-mkdocs.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,28 @@ jobs:
2020
with:
2121
python-version: '3.12'
2222

23+
- name: Set up repository URL with token
24+
run: |
25+
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/NFUChen/pyspring-docs.git
26+
27+
2328
- name: Install dependencies
2429
run: |
2530
python -m pip install --upgrade pip
2631
pip install mkdocs mkdocs-material
2732
mkdocs build
2833
34+
- name: Configuration environment
35+
run: |
36+
mkdir -p ~/.ssh/
37+
echo "$HEXO_DEPLOY_PRI" | tr -d '\r' > ~/.ssh/id_rsa
38+
chmod 600 ~/.ssh/id_rsa
39+
ssh-keyscan github.com >> ~/.ssh/known_hosts
40+
git config --global user.name "xxx"
41+
git config --global user.email "xxx"
42+
2943
- name: Deploy to GitHub Pages
3044
uses: peaceiris/actions-gh-pages@v4
3145
with:
32-
personal_token: ${{ secrets.GH_PAT }}
46+
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
3347
publish_dir: ./site # Path to the output directory

0 commit comments

Comments
 (0)