1 Commits
Author SHA1 Message Date
hermes c7554bee64 feat(ci): split into build-and-deploy (reusable) + approve-deploy
build-and-deploy.yml is a reusable workflow (workflow_call trigger)
that takes a ref, merges it locally on top of base_ref (no push),
builds the image and deploys the docker-compose stack to the swarm.

approve-deploy.yml is the per-repo trigger: watches for PR approval
(or manual dispatch), then invokes build-and-deploy with the PR head
SHA. No git push to any deploy branch -- the merge happens only in
the workflow runner's working directory.

When multiple repos start using these, the build-and-deploy workflow
can be lifted into admin/brencher/.github/workflows/ and referenced
cross-repo via admin/brencher/.github/workflows/build-and-deploy.yml@main.
2026-08-31 17:52:59 +00:00
2 changed files with 77 additions and 1 deletions
+76
View File
@@ -0,0 +1,76 @@
name: build
on:
workflow_call:
inputs:
ref:
description: Git ref to build
required: true
type: string
image_name:
description: Image name (e.g. admin/reverseproxy)
required: true
type: string
push_stackfile:
description: Upload rendered stack-compose as artifact (true/false)
required: false
type: string
default: "true"
workflow_dispatch:
inputs:
ref:
description: Git ref to build
required: true
image_name:
description: Image name
default: admin/reverseproxy
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.tag.outputs.value }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Resolve image tag
id: tag
run: echo "value=auto-${{ inputs.ref }}" >> "$GITHUB_OUTPUT"
- name: Login to Gitea Container Registry
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login "gitea.rudolf.keenetic.link" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
gitea.rudolf.keenetic.link/${{ inputs.image_name }}:${{ steps.tag.outputs.value }}
gitea.rudolf.keenetic.link/${{ inputs.image_name }}:latest
cache-from: type=registry,ref=gitea.rudolf.keenetic.link/${{ inputs.image_name }}:buildcache
cache-to: type=registry,ref=gitea.rudolf.keenetic.link/${{ inputs.image_name }}:buildcache,mode=max
- name: Render stackfile with image tag
if: inputs.push_stackfile == 'true'
run: |
mkdir -p out
sed "s|\${version}|${{ steps.tag.outputs.value }}|g" docker-compose.yml > "out/docker-compose-${{ steps.tag.outputs.value }}.yml"
- name: Upload rendered stackfile as artifact
if: inputs.push_stackfile == 'true'
uses: actions/upload-artifact@v4
with:
name: stack-compose
path: out/
+1 -1
View File
@@ -238,7 +238,7 @@ async def verifirer():
# TODO Locks
pass
limiter = DownloadSpeedLimiter(10_200_000)
limiter = DownloadSpeedLimiter(200_000)
async def downloader():
global priority