diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..6256f18 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,42 @@ +name: Build and Deploy Docs + +on: + push: + branches: + - gh-pages + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U sphinx + + - name: Add docs for files + run: | + sphinx-apidoc -o docs/source/ prefect_orchestration + + - name: Build documentation + run: | + cd docs + make html + + - name: Deploy to GitHub Pages + run: | + git config --global user.email "action@github.com" + git config --global user.name "GitHub Actions" + cd docs/build/html + git init + git add . + git commit -m "Deploy Sphinx documentation" + git push --force --quiet "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" master:gh-pages