canary and promote compiled archied from source on every run, the canary every fifteen minutes. Both now copy the binary out of archied:edge, which deploy already published for main. The canary keeps its checkout: a rollback diffs the migrations between two release tags. Promotion never reads the repository, so it drops its own.
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: canary
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "*/15 * * * *"
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: canary
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
judge:
|
|
if: vars.CANARY_URL != ''
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: main
|
|
fetch-depth: 0
|
|
|
|
- name: Log in to the Gitea registry
|
|
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login git.catlow.cloud -u "${{ github.actor }}" --password-stdin
|
|
|
|
- name: Fetch the published archied
|
|
# The deploy workflow already built this binary. edge is the newest
|
|
# main that passed the gate.
|
|
run: |
|
|
set -e
|
|
image=git.catlow.cloud/sam/archied:edge
|
|
docker pull -q "$image"
|
|
container="$(docker create "$image")"
|
|
docker cp "$container:/usr/local/bin/archied" "$RUNNER_TEMP/archied"
|
|
docker rm "$container" >/dev/null
|
|
|
|
- name: Judge the canary
|
|
env:
|
|
ARCHIE_CANARY_TOKEN: ${{ secrets.CANARY_TOKEN }}
|
|
CANARY_WINDOW: ${{ vars.CANARY_WINDOW }}
|
|
run: |
|
|
window_args=()
|
|
if [ -n "$CANARY_WINDOW" ]; then
|
|
window_args=(-window "$CANARY_WINDOW")
|
|
fi
|
|
"$RUNNER_TEMP/archied" release canary check -dashboard "${{ vars.CANARY_URL }}" \
|
|
"${window_args[@]}" \
|
|
-latest git.catlow.cloud/sam/archied,git.catlow.cloud/sam/archie-agent
|