Skip to content

Commit

Permalink
Streamline documentation update workflow authentication
Browse files Browse the repository at this point in the history
- Use PAT token directly in Git clone and push commands
- Remove redundant remote URL configuration steps
- Simplify authentication mechanism for documentation updates
  • Loading branch information
Chivier committed Jan 27, 2025
1 parent 8300833 commit dbe7566
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
# Checkout the repository
- uses: actions/checkout@v2
# Set up Python 3.8
- uses: actions/setup-python@v4
with:
python-version: '3.8'
# Install Pandoc
- run: |
sudo apt-get update
sudo apt-get install -y pandoc
# Install dependencies and build docs
- run: |
python -m venv venv
source venv/bin/activate
Expand All @@ -29,17 +25,14 @@ jobs:
pip install .
cd ..
sh build_html.sh
# Clone html-en and push updates with PAT auth
- run: cd ..
- run: |
git clone https://github.com/openmlsys/html-en.git
git clone https://${{ secrets.PAT_TOKEN }}@github.com/openmlsys/html-en.git
- run: cp -r _build/html/* html-en/
- run: |
cd html-en
# Authenticate with PAT before pushing
git remote set-url origin https://x-access-token:${{ secrets.GH_TOKEN }}@github.com/openmlsys/html-en.git
git add .
git config user.name "Chivier"
git config user.email "[email protected]"
git add .
git commit -m 'update docs'
git push origin main
git push https://${{ secrets.PAT_TOKEN }}@github.com/openmlsys/html-en.git main

0 comments on commit dbe7566

Please sign in to comment.