Update tag.yml (#7) #12
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
# Ultralytics 🚀 - AGPL-3.0 License https://ultralytics.com/license | |
name: Publish Handbook to GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install black mkdocs-material mkdocs-ultralytics-plugin | |
- name: Build site | |
run: mkdocs build | |
- name: Deploy to GitHub Pages | |
run: | | |
git config --global user.name 'UltralyticsAssistant' | |
git config --global user.email '[email protected]' | |
git fetch origin gh-pages | |
git checkout --track origin/gh-pages || git checkout -b gh-pages | |
git rm -rf . | |
mv site/* . | |
rm -rf site | |
git add . | |
git commit -m "Deploy handbook to GitHub Pages" | |
git push origin gh-pages |