From 813de8e2a967a6692992ffa1c98bc9b64f05c387 Mon Sep 17 00:00:00 2001 From: "every.channel" Date: Mon, 16 Feb 2026 01:39:41 -0500 Subject: [PATCH] ci: fetch source tarball + breadcrumb status --- .forgejo/workflows/deploy-cloudflare.yml | 55 +++++++++++++++++++++--- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/deploy-cloudflare.yml b/.forgejo/workflows/deploy-cloudflare.yml index 58be484..6645bbf 100644 --- a/.forgejo/workflows/deploy-cloudflare.yml +++ b/.forgejo/workflows/deploy-cloudflare.yml @@ -13,12 +13,37 @@ jobs: deploy: runs-on: codeberg-medium steps: - - name: Checkout - uses: https://code.forgejo.org/actions/checkout@v4 - with: - token: ${{ github.token }} - fetch-depth: 0 - lfs: false + - name: Fetch Source (no git required) + env: + GITHUB_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + if [[ -z "${GITHUB_TOKEN:-}" ]]; then + echo "error: missing github.token" + exit 2 + fi + if ! command -v curl >/dev/null 2>&1; then + echo "error: curl is required" + exit 2 + fi + if ! command -v tar >/dev/null 2>&1; then + echo "error: tar is required" + exit 2 + fi + if [[ -z "${GITHUB_SHA:-}" ]]; then + echo "error: missing GITHUB_SHA" + exit 2 + fi + + rm -rf .src + mkdir -p .src + curl -fsSL -H "Authorization: token ${GITHUB_TOKEN}" \ + "https://codeberg.org/every-channel/every.channel/archive/${GITHUB_SHA}.tar.gz" \ + -o .src/src.tgz + tar -xzf .src/src.tgz -C .src --strip-components=1 + rsync -a .src/ ./ + rm -rf .src - name: Bootstrap runner deps shell: bash @@ -74,6 +99,17 @@ jobs: node --version npm --version + - name: CI Breadcrumb (bootstrap ok) + env: + GITHUB_TOKEN: ${{ github.token }} + shell: bash + run: | + set -euo pipefail + curl -fsSL -X POST -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "content-type: application/json" \ + "https://codeberg.org/api/v1/repos/every-channel/every.channel/statuses/${GITHUB_SHA}" \ + -d '{"context":"deploy-cloudflare/breadcrumb","state":"pending","description":"bootstrap ok"}' >/dev/null + - name: Configure CI Age identity env: AGE_FORGE_SSH_KEY: ${{ secrets.AGE_FORGE_SSH_KEY }} @@ -142,9 +178,16 @@ jobs: trunk build --release --public-url / - name: Deploy worker + env: + GITHUB_TOKEN: ${{ github.token }} shell: bash run: | set -euo pipefail cd ../../../deploy/cloudflare-worker npm ci npx wrangler deploy + + curl -fsSL -X POST -H "Authorization: token ${GITHUB_TOKEN}" \ + -H "content-type: application/json" \ + "https://codeberg.org/api/v1/repos/every-channel/every.channel/statuses/${GITHUB_SHA}" \ + -d '{"context":"deploy-cloudflare/breadcrumb","state":"success","description":"deploy ok"}' >/dev/null