2020-09-21 22:03:52 -04:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
2021-07-31 11:58:30 -04:00
|
|
|
build-nix:
|
2020-09-21 22:03:52 -04:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-01-30 10:42:08 -05:00
|
|
|
- uses: actions/checkout@v4
|
2021-08-02 22:29:45 -04:00
|
|
|
|
|
|
|
- name: Install Nix
|
2024-09-13 00:01:51 +00:00
|
|
|
uses: cachix/install-nix-action@V28
|
2021-08-02 22:29:45 -04:00
|
|
|
with:
|
2023-01-28 14:10:41 +13:00
|
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
2021-08-02 22:29:45 -04:00
|
|
|
extra_nix_config: |
|
|
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
2023-01-28 14:10:41 +13:00
|
|
|
allow-import-from-derivation = true
|
|
|
|
auto-optimise-store = true
|
|
|
|
experimental-features = nix-command flakes
|
2024-01-30 10:37:08 -05:00
|
|
|
substituters = https://cache.nixos.org https://cache.iog.io
|
|
|
|
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
|
2021-08-02 22:29:45 -04:00
|
|
|
|
|
|
|
- name: Build with cachix
|
2024-05-21 00:03:31 +00:00
|
|
|
uses: cachix/cachix-action@v15
|
2021-08-02 22:29:45 -04:00
|
|
|
with:
|
|
|
|
name: hakyll-nix-template
|
|
|
|
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
|
|
|
2023-01-28 14:10:41 +13:00
|
|
|
- run: nix build --accept-flake-config
|
2021-08-02 22:29:45 -04:00
|
|
|
|
|
|
|
- name: Artifact pages
|
2024-01-30 10:42:08 -05:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-08-02 22:29:45 -04:00
|
|
|
with:
|
|
|
|
name: pages
|
|
|
|
path: result/dist
|
2020-09-21 22:03:52 -04:00
|
|
|
|
|
|
|
deploy:
|
2020-11-07 17:12:50 -05:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2020-09-21 22:03:52 -04:00
|
|
|
runs-on: ubuntu-latest
|
2021-07-31 11:58:30 -04:00
|
|
|
needs: [build-nix]
|
2020-09-21 22:03:52 -04:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download artifact
|
2024-01-30 10:42:08 -05:00
|
|
|
uses: actions/download-artifact@v4
|
2020-09-21 22:03:52 -04:00
|
|
|
with:
|
|
|
|
name: pages
|
|
|
|
path: result
|
|
|
|
|
2023-01-28 14:10:41 +13:00
|
|
|
- name: Deploy to GitHub Pages
|
2020-09-21 22:03:52 -04:00
|
|
|
if: success()
|
2024-01-30 10:42:08 -05:00
|
|
|
uses: crazy-max/ghaction-github-pages@v4.0.0
|
2020-09-21 22:03:52 -04:00
|
|
|
with:
|
|
|
|
build_dir: result
|
|
|
|
target_branch: gh-pages
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|