Merge pull request #71 from zoom/dev-0.0.4 #60
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: Test, Build & Deploy Documentation | |
| on: | |
| push: | |
| branches: [ "main", "dev" ] | |
| pull_request: | |
| branches: [ "main", "dev" ] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| # Test application build and generate documentation | |
| test-and-build-docs: | |
| name: Test Application & Build Documentation | |
| runs-on: ubuntu-latest | |
| # Only run on main/master branches and if tests pass | |
| if: success() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Docker Compose | |
| uses: docker/[email protected] | |
| - name: Test application build and generate docs | |
| run: docker compose run --rm docs-js | |
| - name: Upload documentation artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: documentation-site | |
| path: ./docs | |
| retention-days: 30 | |
| # Deploy documentation site to GitHub Pages | |
| deploy-documentation: | |
| name: Deploy Documentation Site | |
| runs-on: ubuntu-latest | |
| needs: [test-and-build-docs] | |
| # Only deploy from main/master branch | |
| if: success() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Download documentation site artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: documentation-site | |
| path: ./docs | |
| - name: Setup GitHub Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload site to GitHub Pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './docs' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |