nani.wtf/.github/workflows/main.yml

57 lines
1.4 KiB
YAML
Raw Normal View History

2020-09-22 04:03:52 +02:00
name: CI
on:
pull_request:
push:
jobs:
2021-07-31 17:58:30 +02:00
build-nix:
2020-09-22 04:03:52 +02:00
runs-on: ubuntu-latest
steps:
2021-06-13 06:02:29 +02:00
- uses: actions/checkout@v2.3.4
2020-09-22 04:03:52 +02:00
- name: Install Nix
2021-06-13 06:02:29 +02:00
uses: cachix/install-nix-action@v13
2020-09-22 04:03:52 +02:00
with:
2021-07-31 17:58:30 +02:00
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
2021-06-13 06:02:29 +02:00
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
extra_nix_config: |
experimental-features = nix-command flakes
2021-07-31 17:58:30 +02:00
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
2020-09-22 04:03:52 +02:00
- name: Build with cachix
2021-06-13 06:02:29 +02:00
uses: cachix/cachix-action@v10
2020-09-22 04:03:52 +02:00
with:
2020-09-23 03:06:34 +02:00
name: hakyll-nix-template
2021-07-31 18:23:58 +02:00
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
2020-09-22 04:03:52 +02:00
2021-06-13 06:02:29 +02:00
- run: nix build
2020-09-22 04:03:52 +02:00
- name: Artifact pages
uses: actions/upload-artifact@v2
with:
name: pages
path: result/dist
deploy:
2020-11-07 23:12:50 +01:00
if: github.ref == 'refs/heads/main'
2020-09-22 04:03:52 +02:00
runs-on: ubuntu-latest
2021-07-31 17:58:30 +02:00
needs: [build-nix]
2020-09-22 04:03:52 +02:00
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.5.0
2020-09-22 04:03:52 +02:00
with:
build_dir: result
target_branch: gh-pages
keep_history: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}