ci: fetch source tarball + breadcrumb status
This commit is contained in:
parent
5e85f0342d
commit
813de8e2a9
1 changed files with 49 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue