add automated deployments

This commit is contained in:
41666 2025-05-14 00:40:07 -07:00
parent c54f83ae4d
commit 385210f9ef
4 changed files with 112 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
result

View file

@ -0,0 +1,27 @@
when:
- event: push
branch: main
steps:
- name: build & deploy
image: nixos/nix
# volumes:
# - /nix:/mnt/nix:ro
commands:
- |
echo 'experimental-features = flakes nix-command' >> /etc/nix/nix.conf
#echo 'store = unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt' >> /etc/nix/nix.conf
- nix build -L .
- |
nix-shell -p s3cmd --command 's3cmd \
--host=static-sites.hoki-porgy.ts.net:9000 \
--host-bucket=static-sites.hoki-porgy.ts.net:9000 \
--no-ssl \
sync result/* s3://kitsu.love'
environment:
AWS_ACCESS_KEY_ID:
from_secret: static_sites_client
AWS_SECRET_ACCESS_KEY:
from_secret: static_sites_secret

61
flake.lock generated Normal file
View file

@ -0,0 +1,61 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1746904237,
"narHash": "sha256-3e+AVBczosP5dCLQmMoMEogM57gmZ2qrVSrmq9aResQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d89fc19e405cb2d55ce7cc114356846a0ee5e956",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1743296961,
"narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

23
flake.nix Normal file
View file

@ -0,0 +1,23 @@
{
description = "https://kitsu.love";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
perSystem = { config, self', pkgs, lib, system, ... }: {
packages.default = pkgs.stdenvNoCC.mkDerivation {
name = "noe.sh";
src = ./.;
installPhase = ''
cp -r . $out/
cd $out/
rm -rf .* *.nix *.lock
'';
};
};
};
}