feat: add CI workflow for building and deploying demo to ghpages #1
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: CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: DeterminateSystems/determinate-nix-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Run Nix Build | |
| run: | | |
| nix build .#demo --print-build-logs | |
| - uses: actions/upload-pages-artifact@main | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| path: result | |
| deploy: | |
| name: Deploy | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@main |