update template #29
Workflow file for this run
This file contains hidden or 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: sphinx docs & helm package | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| # - "master" | |
| # - "docs" | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v3 | |
| with: | |
| version: v3.12.0 | |
| - name: Set up Python environment | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r docs/requirements.txt | |
| - name: Build Sphinx documentation | |
| run: | | |
| mkdir -p docs-build | |
| sphinx-build docs/ docs-build/ | |
| rm -rf docs/ | |
| - name: Package Helm chart | |
| run: | | |
| helm package helm/ | |
| helm repo index . --url https://fastmachinelearning.org/SuperSONIC/ | |
| # putting the generated files together with documentation to host on gh-pages | |
| mv *.tgz index.yaml docs-build/ | |
| # Copy metadata for Artifact Hub | |
| cp helm/artifacthub-repo.yaml docs-build/ | |
| - name: Switch to gh-pages branch | |
| run: | | |
| git fetch origin gh-pages | |
| git checkout gh-pages | |
| - name: Add CNAME file for custom domain | |
| run: echo "fastmachinelearning.org/SuperSONIC" > docs-build/CNAME | |
| - name: Commit and push changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Configure Git user | |
| git config user.name "GitHub Actions" | |
| git config user.email "[email protected]" | |
| git rm docs/* -r | |
| rm -rf docs | |
| mv docs-build docs | |
| git add docs | |
| git commit -m "Update Sphinx documentation" || echo "No changes to commit" | |
| git push origin gh-pages |