Skip to content

Commit 8300833

Browse files
committed
Refactor documentation update workflow authentication and push mechanism
- Update Git remote URL configuration to use GitHub token - Simplify authentication and push process for documentation updates - Remove redundant environment variable and push command
1 parent e19fba5 commit 8300833

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

.github/workflows/update_docs.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
11
name: Update Docs
2-
32
on:
43
- push
54
- pull_request
6-
- workflow_dispatch
7-
5+
- workflow_dispatch
86
jobs:
97
build:
108
runs-on: ubuntu-20.04
11-
129
steps:
1310
# Checkout the repository
1411
- uses: actions/checkout@v2
15-
1612
# Set up Python 3.8
1713
- uses: actions/setup-python@v4
1814
with:
1915
python-version: '3.8'
20-
21-
22-
# Install Pandoc using apt-get
16+
# Install Pandoc
2317
- run: |
2418
sudo apt-get update
2519
sudo apt-get install -y pandoc
26-
27-
# Install Python dependencies and build the HTML documentation
20+
# Install dependencies and build docs
2821
- run: |
2922
python -m venv venv
3023
source venv/bin/activate
@@ -36,18 +29,17 @@ jobs:
3629
pip install .
3730
cd ..
3831
sh build_html.sh
39-
40-
# Clone the html-en repository
32+
# Clone html-en and push updates with PAT auth
4133
- run: cd ..
4234
- run: |
4335
git clone https://github.com/openmlsys/html-en.git
4436
- run: cp -r _build/html/* html-en/
45-
- env:
46-
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
47-
run: |
48-
cd html-en
37+
- run: |
38+
cd html-en
39+
# Authenticate with PAT before pushing
40+
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/openmlsys/html-en.git
4941
git add .
5042
git config user.name "Chivier"
5143
git config user.email "[email protected]"
5244
git commit -m 'update docs'
53-
git push https://[email protected]/openmlsys/html-en.git HEAD:main
45+
git push origin main

0 commit comments

Comments
 (0)