Deploy Specs to GitHub Pages #73
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 Specs to GitHub Pages | |
| on: | |
| workflow_run: | |
| workflows: ['Generate Code Samples'] | |
| types: | |
| - completed | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: 'pages' | |
| cancel-in-progress: false | |
| jobs: | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Copy spec files to docs directory | |
| run: | | |
| # Create directory structure if it doesn't exist | |
| mkdir -p docs/specs/source docs/specs/merged docs/specs/final | |
| # Copy source specs | |
| cp -R source_specs/*.yaml docs/specs/source/ | |
| # Copy final processed specs | |
| cp -R final_specs/*.yaml docs/specs/final/ | |
| - name: Build with Jekyll | |
| uses: actions/jekyll-build-pages@v1 | |
| with: | |
| source: ./docs | |
| destination: ./_site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |