fix #74
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: [ push, pull_request ] | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
nix-channel-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v15 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- env: | |
NIX_CACHE_PRIV_KEY: ${{ secrets.NIX_CACHE_PRIV_KEY }} | |
shell: bash | |
run: | | |
set -e -x -o pipefail | |
mkdir -p "_output/cache" | |
echo "nix.hydro.ac" >"_output/CNAME" | |
git rev-parse HEAD >"_output/git-revision" | |
tar -cJf "_output/nixexprs.tar.xz" ./*.nix \ | |
--transform "s,^,${PWD##*/}/," \ | |
--owner=0 --group=0 --mtime="1970-01-01 00:00:00 UTC" | |
touch "_output/index.html" | |
printf 'https://nix-bin.hydro.ac/' >"_output/binary-cache-url" | |
# mapfile -t OUT_PATHS < <(nix-build) | |
# export NIX_SECRET_KEY_FILE="$PWD/nix-cache-priv-key.pem" | |
# echo "$NIX_CACHE_PRIV_KEY" >"$NIX_SECRET_KEY_FILE" | |
# nix store sign -k "$NIX_SECRET_KEY_FILE" "${OUT_PATHS[@]}" | |
# nix copy --to "file:///$PWD/_output/cache" "${OUT_PATHS[@]}" | |
echo "Priority: 40" >>"_output/cache/nix-cache-info" | |
- name: deploy | |
uses: JamesIves/[email protected] | |
if: github.ref == 'refs/heads/master' | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: _output |