ci: fetch source tarball + breadcrumb status

This commit is contained in:
every.channel 2026-02-16 01:39:41 -05:00
parent 5e85f0342d
commit 813de8e2a9
No known key found for this signature in database

View file

@ -13,12 +13,37 @@ jobs:
deploy: deploy:
runs-on: codeberg-medium runs-on: codeberg-medium
steps: steps:
- name: Checkout - name: Fetch Source (no git required)
uses: https://code.forgejo.org/actions/checkout@v4 env:
with: GITHUB_TOKEN: ${{ github.token }}
token: ${{ github.token }} shell: bash
fetch-depth: 0 run: |
lfs: false 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 - name: Bootstrap runner deps
shell: bash shell: bash
@ -74,6 +99,17 @@ jobs:
node --version node --version
npm --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 - name: Configure CI Age identity
env: env:
AGE_FORGE_SSH_KEY: ${{ secrets.AGE_FORGE_SSH_KEY }} AGE_FORGE_SSH_KEY: ${{ secrets.AGE_FORGE_SSH_KEY }}
@ -142,9 +178,16 @@ jobs:
trunk build --release --public-url / trunk build --release --public-url /
- name: Deploy worker - name: Deploy worker
env:
GITHUB_TOKEN: ${{ github.token }}
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
cd ../../../deploy/cloudflare-worker cd ../../../deploy/cloudflare-worker
npm ci npm ci
npx wrangler deploy 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