Merge pull request #6 from litlfred/copilot/fix-68751953-ec1b-4f7f-ba… #35
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: Deploy Documentation to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main, copilot/fix-1 ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build documentation | |
| run: | | |
| mkdir -p dist | |
| cp README.md dist/ | |
| cp -r docs/ dist/ | |
| cp packages/fmlrunner-rest/openapi.yaml dist/ | |
| echo "# FML Runner Documentation" > dist/index.html | |
| echo "<h2>Available Documentation:</h2>" >> dist/index.html | |
| echo "<ul>" >> dist/index.html | |
| echo "<li><a href='README.md'>README</a></li>" >> dist/index.html | |
| echo "<li><a href='docs/'>Documentation</a></li>" >> dist/index.html | |
| echo "<li><a href='openapi.yaml'>OpenAPI Specification</a></li>" >> dist/index.html | |
| echo "</ul>" >> dist/index.html | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| with: | |
| enablement: true | |
| continue-on-error: true | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'dist' | |
| continue-on-error: true | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/copilot/fix-1' | |
| continue-on-error: true | |
| - name: Pages deployment status | |
| if: failure() | |
| run: | | |
| echo "GitHub Pages deployment failed. This is likely because:" | |
| echo "1. GitHub Pages is not enabled for this repository" | |
| echo "2. Pages is not configured to use GitHub Actions as the source" | |
| echo "" | |
| echo "To fix this:" | |
| echo "1. Go to repository Settings > Pages" | |
| echo "2. Under 'Build and deployment', select 'GitHub Actions' as the source" | |
| echo "3. Re-run this workflow" | |
| echo "" | |
| echo "The documentation files have still been built and are available in the workflow artifacts." |