Skip to content

Commit 5698ee6

Browse files
author
Erfan Ghofrani
committed
fix action
1 parent 72690f3 commit 5698ee6

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
name: Deploy
2+
23
on:
34
push:
45
branches: [main]
56

7+
# Ensure GITHUB_TOKEN has write permissions to create/update the gh-pages branch
8+
permissions:
9+
contents: write
10+
611
jobs:
712
deploy:
813
runs-on: ubuntu-latest
@@ -11,12 +16,35 @@ jobs:
1116
uses: actions/checkout@v3
1217
with:
1318
fetch-depth: 0
14-
- uses: actions/setup-python@v2
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v4
1522
with:
1623
python-version: '3.x'
17-
- run: python src/generate_html.py
18-
- uses: peaceiris/actions-gh-pages@v3
24+
25+
- name: Install dependencies
26+
run: |
27+
if [ -f requirements.txt ]; then
28+
pip install --upgrade pip
29+
pip install -r requirements.txt
30+
fi
31+
32+
- name: Debug file structure
33+
run: |
34+
echo "Workspace contents:" && ls -R .
35+
36+
- name: Generate HTML
37+
run: python src/generate_html.py
38+
39+
- name: List docs directory
40+
run: |
41+
echo "Docs directory after generation:" && ls -R docs
42+
43+
- name: Deploy to gh-pages
44+
uses: peaceiris/actions-gh-pages@v3
1945
with:
2046
github_token: ${{ secrets.GITHUB_TOKEN }}
2147
publish_dir: docs
2248
publish_branch: gh-pages
49+
force_orphan: true
50+
clean: true

0 commit comments

Comments
 (0)