Remove env= setting from generated config (not available in V2 Settin… #23
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: Generate and Deploy Documentation | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Generate documentation | |
| generate-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Crystal | |
| uses: crystal-lang/install-crystal@v1 | |
| with: | |
| crystal: latest | |
| - name: Install dependencies | |
| run: shards install | |
| - name: Generate documentation | |
| run: | | |
| crystal docs \ | |
| --project-name="Amber CLI" \ | |
| --project-version="${GITHUB_REF_NAME:-main}" \ | |
| --source-url-pattern="https://github.com/amberframework/amber_cli/blob/%{refname}/%{path}#L%{line}" \ | |
| --output=docs \ | |
| --format=html \ | |
| --sitemap-base-url="https://amberframework.github.io/amber_cli/" \ | |
| --canonical-base-url="https://amberframework.github.io/amber_cli/" | |
| - name: Setup Pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./docs | |
| # Deploy to GitHub Pages (only on main branch) | |
| deploy-docs: | |
| if: github.ref == 'refs/heads/main' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: generate-docs | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |