ci: convert builds.sr.ht manifest to forgejo actions workflow
All checks were successful
deploy / build (push) Successful in 1m12s
All checks were successful
deploy / build (push) Successful in 1m12s
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
parent
b0ee6d8970
commit
d15dac3374
20
.build.yml
20
.build.yml
|
@ -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
|
39
.forgejo/workflows/deploy.yaml
Normal file
39
.forgejo/workflows/deploy.yaml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
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 nixpkgs.gnutar nixpkgs.openssh
|
||||
|
||||
- name: checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: check
|
||||
run: nix flake check -L
|
||||
|
||||
- name: build
|
||||
run: nix build .#
|
||||
|
||||
- name: setup deploy-via-ssh
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo 'fort.c8h4.io ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFFOE4T7/1+13rqroj6xB6UI8l11OqvWbcE5NFvhY7v+' >~/.ssh/known_hosts
|
||||
echo "${{ secrets.SSH_KEY }}" >~/.ssh/id_ed25519
|
||||
chmod 0600 ~/.ssh/id_ed25519
|
||||
|
||||
- name: deploy
|
||||
run: |
|
||||
tar -C result -cvzf site.tar.gz .
|
||||
cat <(echo c8h4.io) <(cat site.tar.gz) | ssh -T deploy@fort.c8h4.io
|
Loading…
Reference in a new issue