add actions and jobs for automatic updates #38

Merged
clan-bot merged 11 commits from actions into main 2023-07-28 12:03:45 +00:00
2 changed files with 35 additions and 0 deletions
Showing only changes of commit 366d35039b - Show all commits

View File

@ -0,0 +1,23 @@
{
perSystem =
{ config
, pkgs
, ...
}:
let
name = builtins.baseNameOf ./.;
script = config.writers.writePureShellScriptBin
name
[
pkgs.bash
pkgs.coreutils
pkgs.tea
]
''
bash ${./script.sh}
'';
in
{
packages.${name} = script;
};
}

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$(tea login list -o simple | wc -l)" -gt 0 ]; then
exit 0
fi
GITEA_TOKEN="${GITEA_TOKEN:-"$(cat "$GITEA_TOKEN_FILE")"}"
tea login add \
--token $GITEA_TOKEN \
--url $GITEA_URL