Skip to content

Commit 9c2a6b9

Browse files
committed
Actions deploy to github pages
1 parent e9e7fed commit 9c2a6b9

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

.github/workflows/build_deploy.yaml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,43 @@ on:
1212

1313
permissions:
1414
contents: read
15+
pages: write
16+
id-token: write
1517

1618
jobs:
17-
build-and-deploy:
19+
build:
1820
runs-on: ubuntu-latest
1921

2022
steps:
2123
- name: Checkout repository
2224
uses: actions/checkout@v4
2325

24-
- name: Set up Python
26+
- name: Setup Python
2527
uses: actions/setup-python@v5
2628
with:
27-
python-version: '3.9'
29+
python-version: '3.11'
2830

29-
- name: Install MkDocs and theme
30-
run: pip install mkdocs-material
31+
- name: Install MkDocs
32+
run: |
33+
pip install mkdocs-material
3134
3235
- name: Build site
3336
run: mkdocs build --clean
3437

35-
- name: Setup SSH
36-
run: |
37-
mkdir -p ~/.ssh
38-
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
39-
chmod 600 ~/.ssh/id_ed25519
40-
ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
38+
- name: Upload Pages artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: site
4142

42-
- name: Deploy with rsync
43-
run: |
44-
rsync -avz --delete site/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:${{ secrets.SSH_TARGET_DIR }}
43+
deploy:
44+
needs: build
45+
runs-on: ubuntu-latest
46+
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)