From cb20ca6e6dd3dec9656549438a871cef21d3c613 Mon Sep 17 00:00:00 2001 From: Till Klampaeckel Date: Wed, 16 Oct 2024 12:24:01 +0200 Subject: [PATCH] Update(release): workflow to update the caddy-docker-proxy module --- .github/workflows/update-cdp.yml | 25 +++++++++++++++++ rootfs/Dockerfile | 4 ++- updatecli/updatecli.d/cdp.yaml | 48 ++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-cdp.yml create mode 100644 updatecli/updatecli.d/cdp.yaml diff --git a/.github/workflows/update-cdp.yml b/.github/workflows/update-cdp.yml new file mode 100644 index 0000000..0514845 --- /dev/null +++ b/.github/workflows/update-cdp.yml @@ -0,0 +1,25 @@ +name: update + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +permissions: + contents: "write" + pull-requests: "write" + +jobs: + updatecli: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v4 + - uses: updatecli/updatecli-action@v2 + - run: updatecli diff --config ./updatecli/updatecli.d + env: + UPDATECLI_GITHUB_ACTOR: ${{ github.actor }} + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: updatecli apply --debug --config ./updatecli/updatecli.d + env: + UPDATECLI_GITHUB_ACTOR: ${{ github.actor }} + UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 8838573..a24d858 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -1,8 +1,10 @@ FROM caddy:2.8.4-builder as builder +ARG CDP_VERSION=v2.9.1 + RUN xcaddy build \ --with github.com/ss098/certmagic-s3 \ - --with github.com/lucaslorentz/caddy-docker-proxy@v2.9.1 + --with github.com/lucaslorentz/caddy-docker-proxy@${CDP_VERSION} FROM caddy:2.8.4 diff --git a/updatecli/updatecli.d/cdp.yaml b/updatecli/updatecli.d/cdp.yaml new file mode 100644 index 0000000..9d38190 --- /dev/null +++ b/updatecli/updatecli.d/cdp.yaml @@ -0,0 +1,48 @@ +name: Update caddy-docker-proxy from upstream + +scms: + default: + kind: github + spec: + user: hostwithquantum + email: team+updates@planetary-quantum.com + username: '{{ requiredEnv "UPDATECLI_GITHUB_ACTOR" }}' + owner: "hostwithquantum" + repository: "quantum-caddy" + token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' + branch: "main" + +sources: + cdp: + name: Get latest release + kind: githubrelease + spec: + owner: "lucaslorentz" + repository: "caddy-docker-proxy" + token: '{{ requiredEnv "UPDATECLI_GITHUB_TOKEN" }}' + versionfilter: + kind: latest + +targets: + dockerfile: + name: Update Dockerfile ARG CDP_VERSION + kind: dockerfile + scmid: default + sourceid: cdp + spec: + file: Dockerfile + instruction: + keyword: ARG + matcher: CDP_VERSION + +actions: + default: + kind: github/pullrequest + scmid: default + title: 'Update caddy-docker-proxy version to {{ source "cdp" }}' + spec: + automerge: false + draft: false + labels: + - dependencies + - enhancement