"...resnet50_tensorflow.git" did not exist on "90b8e658f223936e23ab44c99daabb4030e005c9"
Commit f7dd101c authored by Wenhao Xie's avatar Wenhao Xie Committed by GitHub
Browse files

[Doc][CI] Update GitHub Actions workflow for documentation build and deployment. (#42)

* [Doc][CI] Update GitHub Actions workflow for documentation build and deployment.

* [Doc][CI] Remove redundant git add command in GitHub Actions workflow.

* [CI] Add workflow_dispatch trigger to publish_docs workflow
parent 3f38c10c
......@@ -4,6 +4,7 @@ on:
pull_request:
types:
- closed
workflow_dispatch:
permissions:
contents: write
......@@ -12,23 +13,33 @@ jobs:
docs:
if: ${{ github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
- name: Build docs
run: |
pip install -r requirements.txt
- name: Sphinx build
chmod +x ./maint/scripts/build_docs.sh
./maint/scripts/build_docs.sh
- name: Configure git
run: |
make html
cp CNAME _build/html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
force_orphan: true
git config --global user.email "tilelang@outlook.com"
git config --global user.name "GitHub Actions"
- name: Push to another repo
env:
TARGET_REPO: ${{ secrets.TARGET_REPO }}
TARGET_TOKEN: ${{ secrets.TARGET_TOKEN }}
run: |
git config --global url."https://$TARGET_TOKEN@github.com".insteadOf "https://github.com"
git clone https://github.com/${TARGET_REPO}.git target_repo
cd target_repo
git checkout main
cp -r ../docs/_build/html/* ./
git add .
if [[ -n "$(git status --porcelain)" ]]; then
# If there are changes, commit and push
git commit -m "Update docs"
git push https://github.com/${TARGET_REPO}.git main
else
echo "No changes detected, skipping commit and push."
fi
#!/bin/bash
cd docs
pip install -r requirements.txt
make html
cp CNAME _build/html/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment