fabianhauser.ch/.github/workflows/ci.yml

31 lines
778 B
YAML
Raw Normal View History

2024-09-14 17:18:15 +02:00
name: CI
on:
push:
pull_request:
2024-09-28 21:40:07 +02:00
defaults:
run:
shell: "nix shell nixpkgs#git-lfs --command {0}"
2024-09-14 17:18:15 +02:00
jobs:
build:
container: nixpkgs/nix-flakes:nixos-24.05
2024-09-14 17:18:15 +02:00
steps:
2024-09-28 21:40:07 +02:00
- name: Initialize CI
uses: https://git.qo.is/qo.is/actions-nix-init@67773e9204de19a5a40166ba15be425b4c8624b6
- name: Build
run: nix build
- name: Run Checks
run: nix flake check
2024-09-28 21:40:07 +02:00
- name: Deploy
if: success() && github.ref == 'refs/heads/main'
run: |
mkdir ~/.ssh/
(umask 0077 && printf "%s" "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/id_ed25519 && echo >> ~/.ssh/id_ed25519)
echo -e "Host lindberg-webapps.backplane.net.qo.is\n StrictHostKeyChecking no" >> ~/.ssh/config
nix run .#deploy