Skip to content

[CI] Auto update dependencies (#20) #55

[CI] Auto update dependencies (#20)

[CI] Auto update dependencies (#20) #55

Workflow file for this run

name: Make doc
on:
push:
branches:
main
pull_request:
branches:
main
jobs:
build_doc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build the doc
run: |
cd docs/ && pip install -r requirements.txt
make html && cd ..
- name: Refresh changes and commit
if: github.event_name == 'push'
run: |
git clone https://github.com/Meloland/melobot.git --branch gh-pages --single-branch gh-pages
mkdir tmp-files && cd gh-pages
mv CNAME .nojekyll README.md .git ../tmp-files
rm -rf * && rm .buildinfo && cd ..
cp -r docs/build/html/* gh-pages
cp docs/build/html/.buildinfo gh-pages
mv tmp-files/* tmp-files/.git tmp-files/.nojekyll gh-pages
rmdir tmp-files
cd gh-pages
git config --local user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
git add .
git commit -m "Update doc by Github Action" -a || true
cd ..
- name: Push changes
if: github.event_name == 'push'
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}