website/.github/workflows/main.yml

59 lines
1.6 KiB
YAML
Raw Normal View History

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
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
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
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 }}