2020-09-22 04:03:52 +02:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Nix
|
2020-11-05 04:38:19 +01:00
|
|
|
uses: cachix/install-nix-action@v12
|
2020-09-22 04:03:52 +02:00
|
|
|
with:
|
|
|
|
skip_adding_nixpkgs_channel: true
|
|
|
|
|
|
|
|
- name: Build with cachix
|
2020-11-05 04:38:19 +01:00
|
|
|
uses: cachix/cachix-action@v7
|
2020-09-22 04:03:52 +02:00
|
|
|
with:
|
2020-09-23 03:06:34 +02:00
|
|
|
name: hakyll-nix-template
|
2020-09-22 04:03:52 +02:00
|
|
|
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
|
|
|
|
#authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
|
|
|
|
|
|
- run: nix-build
|
|
|
|
- run: nix-shell --run "echo OK"
|
|
|
|
|
|
|
|
- name: Artifact pages
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: pages
|
|
|
|
path: result/dist
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Download artifact
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: pages
|
|
|
|
path: result
|
|
|
|
|
|
|
|
- name: GitHub Pages
|
|
|
|
if: success()
|
|
|
|
uses: crazy-max/ghaction-github-pages@v2
|
|
|
|
with:
|
|
|
|
build_dir: result
|
|
|
|
target_branch: gh-pages
|
|
|
|
keep_history: false
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|