Build / build-and-push (push) Successful in 23s
Stock caddy:2-alpine plus caddy-dns/desec, for ACME DNS-01 against zones hosted at deSEC (*.llm.aneur.in in cloud/cloud's llm stack). CI builds and checks the module on pull requests, and pushes :latest (keeping :previous) on main, weekly and by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
schedule:
|
|
# Weekly, so new Caddy and caddy-dns/desec releases land without a commit.
|
|
- cron: "17 4 * * 1"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker:cli
|
|
env:
|
|
IMAGE: code.aneur.in/${{ gitea.repository }}
|
|
steps:
|
|
- name: Install Node (for checkout)
|
|
run: apk add --no-cache nodejs
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build
|
|
run: docker build --pull --tag "$IMAGE:latest" .
|
|
|
|
- name: Check the deSEC module is built in
|
|
run: docker run --rm "$IMAGE:latest" caddy list-modules | grep -x dns.providers.desec
|
|
|
|
- name: Log in to the container registry
|
|
env:
|
|
BUILD_API_TOKEN: ${{ secrets.BUILD_API_TOKEN }}
|
|
run: echo "$BUILD_API_TOKEN" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin
|
|
|
|
- name: Promote current "latest" to "previous"
|
|
run: |
|
|
if docker buildx imagetools inspect "$IMAGE:latest" >/dev/null 2>&1; then
|
|
docker buildx imagetools create -t "$IMAGE:previous" "$IMAGE:latest"
|
|
else
|
|
echo "No existing :latest to promote; skipping."
|
|
fi
|
|
|
|
- name: Push "latest"
|
|
run: docker push "$IMAGE:latest"
|