2023-10-29 05:57:20 +01:00
|
|
|
name: Build and deploy
|
2023-10-29 05:46:53 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
|
2023-10-29 05:57:20 +01:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
2023-10-29 05:46:53 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
|
|
|
|
- name: Build project
|
2023-10-29 06:28:40 +01:00
|
|
|
run: nix build .#erratic-gate-github-pages
|
2023-10-29 05:46:53 +01:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-pages-artifact@v2
|
|
|
|
with:
|
|
|
|
path: ./result/www
|
2023-10-29 05:57:20 +01:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v2
|