Skip to content

Commit ecfee4a

Browse files
committed
adding workflow
1 parent 7950efd commit ecfee4a

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy MkDocs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.x'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install mkdocs
21+
# Add any other themes or plugins you need
22+
pip install mkdocs-material
23+
- name: Configure Git
24+
run: |
25+
git config --global user.name "GitHub Actions"
26+
git config --global user.email "[email protected]"
27+
- name: Deploy documentation
28+
run: |
29+
mkdocs gh-deploy --force
30+
# Create a CNAME file in the site directory
31+
echo "docs.yourdomain.com" > ./site/CNAME
32+
# Force push to gh-pages branch
33+
cd site
34+
git init
35+
git add .
36+
git commit -m "Deploy documentation updates"
37+
git push --force https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} main:gh-pages

0 commit comments

Comments
 (0)