Newer
Older
variables:
LANG: en_US.UTF-8
# DEPLOY_KEY provided as protected variable
stages:
- build
- deploy
image: nixos/nix
cache:
policy: pull
paths:
- store.nar
before_script:
- |
if [ -f store.nar ]; then
echo "Extracting cached Nix store..."
nix-store --import -vv < store.nar || echo "invalid cache"
else
echo "No cache found"
fi
build:
stage: build
tags:
- x86_64-linux
script:
- nix build -f . --no-link
- nix run -f . -c ghc-homepage build
- |
echo "==============================="
echo "Link Check:"
echo "==============================="
nix run -f . -c check.sh
- nix-store --export $(nix-store -qR --include-outputs $(nix-instantiate --quiet .)) > store.nar
cache:
policy: pull-push
paths:
- store.nar
artifacts:
expire_in: 1 year
paths:
- _site
stage: deploy
dependencies:
- build
tags:
- x86_64-linux
only:
- mv .public public
artifacts:
paths:
- public
deploy-webhost:
stage: deploy
dependencies:
- build
tags:
- x86_64-linux
only:
- master
environment:
name: haskell.org
url: https://haskell.org/ghc
- echo "webhost.haskell.org ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBH2qKrYfhGC/7W/yLGjIkUPozDU+bJSNDFSrilUwyu8H5hbfSnlsBd/HvXvNc3TquDJ1T91J65AjGq+J+2F28Nw=" > $HOME/.ssh/known_hosts
- chown -R 0600 $HOME/.ssh key
- nix run -f . -c rclone sync _site --sftp-key-file=./key --sftp-user=ghc-site --sftp-host=webhost.haskell.org :sftp:/ghc