ci: switch builds.sr.ht manifest to forgejo actions workflow

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2024-07-08 12:24:04 +02:00
parent b0ee6d8970
commit 6c45c15c5f
Signed by: c8h4
GPG key ID: 1538094429952F86
2 changed files with 34 additions and 20 deletions

View file

@ -1,20 +0,0 @@
---
image: nixos/unstable
environment:
NIX_CONFIG: 'experimental-features = nix-command flakes'
sources:
- https://git.sr.ht/~c8h4/c8h4.io
secrets:
- 8e01c227-f772-4dec-b1f5-f21657b709a0
tasks:
- lint: |
cd c8h4.io
nix flake check
- build: |
cd c8h4.io
nix build
- deploy: |
echo 'fort.c8h4.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFFOE4T7/1+13rqroj6xB6UI8l11OqvWbcE5NFvhY7v+' >~/.ssh/known_hosts
tar -C c8h4.io/result -cvzf site.tar.gz .
set +x # do not completely clobber the output with gargabe
cat <(echo c8h4.io) <(cat site.tar.gz) | ssh -T deploy@fort.c8h4.io

View file

@ -0,0 +1,34 @@
---
name: deploy
on:
push:
branches:
- main
env:
NIX_CONFIG: 'experimental-features = nix-command flakes'
jobs:
build:
runs-on: nixos-unstable
steps:
- name: prepare nix container
run: nix-env -iA nixpkgs.nodejs
- name: checkout repository
uses: actions/checkout@v4
- name: check
run: nix flake check -L
- name: build
run: nix build
- name: deploy
env:
SSH_KEY: ${{ secrets.deploy_sshkey }}
TARGET_HOST: ${{ vars.TARGET_HOST }}
run: |
cat <(echo c8h4.io) <(tar -C result/ -cvz .) \
| ssh -i <(echo "$SSH_KEY") -T deploy@$TARGET_HOST