From b562e84b88b7c9b1f75d7dd06ce32b7daf4c04e5 Mon Sep 17 00:00:00 2001 From: Samuel Enocsson Date: Fri, 22 May 2026 14:27:11 +0200 Subject: [PATCH] chore: move composite action to dedicated repo Action lives at gitea.shcizo.se/shcizo/package-updater-action now. --- README.md | 2 +- gitea-action/README.md | 36 ------------------------------------ gitea-action/action.yml | 37 ------------------------------------- 3 files changed, 1 insertion(+), 74 deletions(-) delete mode 100644 gitea-action/README.md delete mode 100644 gitea-action/action.yml diff --git a/README.md b/README.md index b481e41..366fafa 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Defense in depth: a valid bearer token AND the opt-in label must both be present 4. Point your reverse proxy (NPM/Traefik/Caddy) at `package-updater:8080`. NPM should handle TLS. 5. `docker compose up -d`. 6. Add the opt-in label `se.shcizo.auto-update: "true"` to each service you want auto-updated. -7. Use the [Gitea composite action](gitea-action/README.md) in your repos to call `/update` after a build. +7. Use the [Gitea composite action](https://gitea.shcizo.se/shcizo/package-updater-action) in your repos to call `/update` after a build. ## Configuration diff --git a/gitea-action/README.md b/gitea-action/README.md deleted file mode 100644 index bc0816a..0000000 --- a/gitea-action/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Deploy via package-updater (composite action) - -Notifies `package-updater` to `docker compose pull` + `up -d` for the matching service(s) after a CI build. - -## Usage - -In a consumer repo's `.gitea/workflows/deploy.yml`: - -```yaml -jobs: - deploy: - runs-on: ubuntu-latest - needs: [build-and-push] - steps: - - uses: gitea.example.com/shcizo/package-updater/gitea-action@v1 - with: - endpoint: https://updater.example.com/update - image: registry.example.com/${{ gitea.repository }} - tag: ${{ gitea.sha }} - token: ${{ secrets.UPDATER_TOKEN }} -``` - -`UPDATER_TOKEN` should be set as an organisation-level secret in Gitea so all repos share it. - -## Inputs - -| Name | Required | Default | Description | -|---|---|---|---| -| `endpoint` | yes | — | Full URL to `/update` | -| `image` | yes | — | Image reference without tag | -| `tag` | no | `""` | Tag that was just pushed (logged for audit) | -| `token` | yes | — | Bearer token configured in package-updater | - -## Failure modes - -The step exits non-zero if `package-updater` returns HTTP 4xx or 5xx. This is intentional — the workflow surfaces the deploy failure to whoever pushed. diff --git a/gitea-action/action.yml b/gitea-action/action.yml deleted file mode 100644 index 19148e8..0000000 --- a/gitea-action/action.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "Deploy via package-updater" -description: "Notifies package-updater to pull & restart a Docker Compose service" -inputs: - endpoint: - description: "Full URL to /update (e.g. https://updater.example.com/update)" - required: true - image: - description: "Image reference without tag (e.g. registry.example.com/myapp)" - required: true - tag: - description: "Tag that was just pushed (for logging)" - required: false - default: "" - token: - description: "Bearer token for package-updater" - required: true -runs: - using: "composite" - steps: - - name: Trigger update - shell: bash - env: - TOKEN: ${{ inputs.token }} - run: | - set -euo pipefail - response=$(curl -sS -w "\n%{http_code}" \ - -X POST "${{ inputs.endpoint }}" \ - -H "Authorization: Bearer $TOKEN" \ - -H "Content-Type: application/json" \ - -d "{\"image\":\"${{ inputs.image }}\",\"tag\":\"${{ inputs.tag }}\"}") - body=$(echo "$response" | head -n -1) - code=$(echo "$response" | tail -n 1) - echo "HTTP $code" - echo "$body" | jq . - if [ "$code" -ge 400 ]; then - exit 1 - fi -- 2.52.0