Skip to content

Commit

Permalink
chore(workflow): update publish_docs.yml to use latest actions and fi…
Browse files Browse the repository at this point in the history
…x git user setup

Update the GitHub Actions workflow to use the latest versions of actions and ensure proper Git user setup for deploying documentation.

Signed-off-by: longhao <hal.long@outlook.com>
  • Loading branch information
loonghao committed Dec 29, 2024
1 parent b808eaa commit b90d421
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,31 @@ jobs:
docs:
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
contents: write
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: pip install --upgrade pip && python -m pip install -U pip poetry
- run: poetry --version
- run: poetry install
- name: Publish docs

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Setup Git User
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Build and Deploy Documentation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh --version
poetry run mkdocs gh-deploy --remote-branch gh-pages
poetry run mkdocs gh-deploy --force --remote-branch gh-pages

0 comments on commit b90d421

Please sign in to comment.