You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TRaSH-Guides/.github/workflows/deploy.yml

40 lines
989 B

name: Build mkdocs and deploy to GitHub Pages
4 years ago
on: [push, pull_request]
4 years ago
jobs:
build:
name: Build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- run: pip install -r docs/requirements.txt
- run: mkdocs build
deploy:
if: github.event_name == 'push' && contains(fromJson('["refs/heads/master", "refs/heads/main"]'), github.ref)
needs: build
4 years ago
name: Deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-python@v4
4 years ago
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- run: pip install -r docs/requirements.txt
4 years ago
- run: mkdocs gh-deploy --force