The stack's settings are repo variables, its secrets repo secrets, and NATS_PASSWORD an org secret the content repo can share. The deploy workflow checks they are all set, writes .env, portal.env, nats.env and chat.env into the runner's own directory, and the root script (now in the repo as deploy-tomtervel) pulls main, puts them in place as root's and brings the stack up. So nothing is edited on the host or committed: a host name or a version is a variable changed and a Run workflow. nats.conf reads NATS_PASSWORD from its environment, so it is committed rather than rendered. bootstrap.sh only makes Kanidm's config and certificate and recovers its admins; kanidm-setup.sh reads portal.env, and leaves the two secrets it makes in kanidm-setup.secrets for gt. The DNS workflow uses actions/checkout and actions/cache (the runner's cache server) for dnscontrol, at the DNSCONTROL_VERSION variable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L5fbDmSQSb6u27EiEuwzoM
This commit is contained in:
12 files changed
+282
-207
No files matched your search
+30
-29
@@ -20,43 +20,44 @@ jobs:
|
||||
dns:
|
||||
runs-on: fish
|
||||
env:
|
||||
DNSCONTROL_VERSION: 5.7.2
|
||||
DNSCONTROL_VERSION: ${{ vars.DNSCONTROL_VERSION }}
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
steps:
|
||||
- name: checkout
|
||||
run: |
|
||||
rm -rf checkout
|
||||
git clone --depth 1 --branch "${{ github.ref_name }}" "${{ github.server_url }}/${{ github.repository }}.git" checkout
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# The release binary, checked against the release's own checksums,
|
||||
# kept in the runner user's cache so each version is fetched once.
|
||||
- name: dnscontrol
|
||||
# The release binary, fetched once per version into the runner's
|
||||
# own cache (its built-in cache server) and checked against the
|
||||
# release's checksums when it is.
|
||||
- name: Cache dnscontrol
|
||||
id: cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/dnscontrol
|
||||
key: dnscontrol-${{ vars.DNSCONTROL_VERSION }}-linux-amd64
|
||||
|
||||
- name: Fetch dnscontrol
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
mkdir -p "$HOME/.cache/dnscontrol"
|
||||
bin="$HOME/.cache/dnscontrol/dnscontrol-$DNSCONTROL_VERSION"
|
||||
if [ ! -x "$bin" ]; then
|
||||
tmp=$(mktemp -d)
|
||||
base="https://github.com/StackExchange/dnscontrol/releases/download/v$DNSCONTROL_VERSION"
|
||||
tar="dnscontrol_${DNSCONTROL_VERSION}_linux_amd64.tar.gz"
|
||||
curl -sfL "$base/$tar" -o "$tmp/$tar"
|
||||
curl -sfL "$base/checksums.txt" -o "$tmp/checksums.txt"
|
||||
(cd "$tmp" && grep " $tar\$" checksums.txt | sha256sum -c -)
|
||||
tar -xzf "$tmp/$tar" -C "$tmp" dnscontrol
|
||||
install -m 0755 "$tmp/dnscontrol" "$bin"
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
"$bin" version
|
||||
echo "DNSCONTROL=$bin" >> "$GITHUB_ENV"
|
||||
[ -n "$DNSCONTROL_VERSION" ] || { echo "the DNSCONTROL_VERSION variable is not set"; exit 1; }
|
||||
mkdir -p ~/.cache/dnscontrol
|
||||
cd "$(mktemp -d)"
|
||||
base="https://github.com/StackExchange/dnscontrol/releases/download/v$DNSCONTROL_VERSION"
|
||||
tar="dnscontrol_${DNSCONTROL_VERSION}_linux_amd64.tar.gz"
|
||||
curl -sfLO "$base/$tar"
|
||||
curl -sfLO "$base/checksums.txt"
|
||||
grep " $tar\$" checksums.txt | sha256sum -c -
|
||||
tar -xzf "$tar" dnscontrol
|
||||
install -m 0755 dnscontrol ~/.cache/dnscontrol/dnscontrol
|
||||
|
||||
- name: check
|
||||
working-directory: checkout/dns
|
||||
run: $DNSCONTROL check
|
||||
working-directory: dns
|
||||
run: ~/.cache/dnscontrol/dnscontrol check
|
||||
|
||||
- name: preview
|
||||
working-directory: checkout/dns
|
||||
run: $DNSCONTROL preview
|
||||
working-directory: dns
|
||||
run: ~/.cache/dnscontrol/dnscontrol preview
|
||||
|
||||
- name: push
|
||||
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'
|
||||
working-directory: checkout/dns
|
||||
run: $DNSCONTROL push
|
||||
working-directory: dns
|
||||
run: ~/.cache/dnscontrol/dnscontrol push
|
||||
Reference in new issue
Block a user