[melobot] Fix error retcode when running on cli dev mode #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |