ci: switch deploy secrets to age key workflow
This commit is contained in:
parent
d6a9af8f1e
commit
4dbd831d0b
10 changed files with 186 additions and 30 deletions
|
|
@ -9,13 +9,19 @@ cd "${root}"
|
|||
# Auth token source order:
|
||||
# 1) CODEBERG_TOKEN env var
|
||||
# 2) `agenix -d secrets/codeberg-token.age` (optional)
|
||||
# 3) `age -d -i <identity> secrets/codeberg-token.age` (optional)
|
||||
|
||||
rules_file="${EVERY_CHANNEL_AGE_RULES_FILE:-./secrets.nix}"
|
||||
identity_file="${EVERY_CHANNEL_AGE_IDENTITY_FILE:-$HOME/.config/every.channel/keys/founder_ed25519}"
|
||||
|
||||
if [[ -z "${CODEBERG_TOKEN:-}" && -f secrets/codeberg-token.age && -x "$(command -v agenix)" ]]; then
|
||||
export CODEBERG_TOKEN
|
||||
CODEBERG_TOKEN="$(RULES="${rules_file}" agenix -d secrets/codeberg-token.age -i "${identity_file}")"
|
||||
if [[ -z "${CODEBERG_TOKEN:-}" && -f secrets/codeberg-token.age ]]; then
|
||||
if command -v agenix >/dev/null 2>&1; then
|
||||
export CODEBERG_TOKEN
|
||||
CODEBERG_TOKEN="$(RULES="${rules_file}" agenix -d secrets/codeberg-token.age -i "${identity_file}")"
|
||||
elif command -v age >/dev/null 2>&1; then
|
||||
export CODEBERG_TOKEN
|
||||
CODEBERG_TOKEN="$(age -d -i "${identity_file}" secrets/codeberg-token.age)"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z "${CODEBERG_TOKEN:-}" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue