Compare commits

...

2 Commits

Author SHA1 Message Date
ejlewis 2b3a18f208 ci: add Cloudflare Pages deploy + split success/failure notify
ci/woodpecker/push/woodpecker Pipeline was successful
Mirrors the ethanjlewis.com pipeline structure:

- single combined build step (npm ci + test + build)
- deploy via npx wrangler to project halfstreet-io
- notify-success at priority 0, notify-failure at priority 1
- triggers on push to main + manual

Secret names are lowercase (cloudflare_api_token, cloudflare_account_id,
pushover_token, pushover_user) to match what's configured on the
halfstreet repo in Woodpecker.
2026-05-09 11:56:38 -05:00
ejlewis 72f99295ca build: re-add wrangler as devDependency
Needed by the deploy step (npx wrangler pages deploy). Keeping it as a
local devDep means CI doesn't re-download wrangler on every run, matching
how ethanjlewis.com is set up.
2026-05-09 11:56:38 -05:00
3 changed files with 936 additions and 31 deletions
+44 -26
View File
@@ -1,23 +1,27 @@
when: when:
- event: [push, pull_request, manual] - event: push
branch: [main]
- event: manual
steps: steps:
- name: install - name: build
image: node:22-alpine image: node:22
commands: commands:
- npm ci - npm ci
- npm run test
- name: test
image: node:22-alpine
commands:
- npm test
- name: build
image: node:22-alpine
commands:
- npm run build - npm run build
- name: notify - name: deploy
image: node:22
environment:
CLOUDFLARE_API_TOKEN:
from_secret: cloudflare_api_token
CLOUDFLARE_ACCOUNT_ID:
from_secret: cloudflare_account_id
commands:
- npx wrangler pages deploy ./dist --project-name halfstreet-io --branch $CI_COMMIT_BRANCH
- name: notify-success
image: curlimages/curl:latest image: curlimages/curl:latest
environment: environment:
PUSHOVER_TOKEN: PUSHOVER_TOKEN:
@@ -26,21 +30,35 @@ steps:
from_secret: pushover_user from_secret: pushover_user
commands: commands:
- | - |
if [ "$CI_PIPELINE_STATUS" = "success" ]; then curl -sS --fail-with-body \
TITLE="Halfstreet CI passed"
PRIORITY=-1
else
TITLE="Halfstreet CI failed"
PRIORITY=0
fi
curl -s \
--form-string "token=$PUSHOVER_TOKEN" \ --form-string "token=$PUSHOVER_TOKEN" \
--form-string "user=$PUSHOVER_USER" \ --form-string "user=$PUSHOVER_USER" \
--form-string "title=$TITLE" \ --form-string "title=halfstreet.io deployed" \
--form-string "priority=$PRIORITY" \ --form-string "message=Build $CI_PIPELINE_NUMBER succeeded on $CI_COMMIT_BRANCH — $CI_COMMIT_MESSAGE" \
--form-string "message=$CI_COMMIT_BRANCH: $CI_COMMIT_MESSAGE" \ --form-string "priority=0" \
--form-string "url=$CI_PIPELINE_URL" \ --form-string "url=$CI_PIPELINE_URL" \
--form-string "url_title=View pipeline" \ --form-string "url_title=View build" \
https://api.pushover.net/1/messages.json https://api.pushover.net/1/messages.json
when: when:
- status: [success, failure] - status: success
- name: notify-failure
image: curlimages/curl:latest
environment:
PUSHOVER_TOKEN:
from_secret: pushover_token
PUSHOVER_USER:
from_secret: pushover_user
commands:
- |
curl -sS --fail-with-body \
--form-string "token=$PUSHOVER_TOKEN" \
--form-string "user=$PUSHOVER_USER" \
--form-string "title=halfstreet.io build failed" \
--form-string "message=Build $CI_PIPELINE_NUMBER failed on $CI_COMMIT_BRANCH — $CI_COMMIT_MESSAGE" \
--form-string "priority=1" \
--form-string "url=$CI_PIPELINE_URL" \
--form-string "url_title=View build" \
https://api.pushover.net/1/messages.json
when:
- status: failure
+890 -4
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -23,6 +23,7 @@
"@astrojs/check": "^0.9.8", "@astrojs/check": "^0.9.8",
"@types/node": "^25.6.0", "@types/node": "^25.6.0",
"typescript": "^5.9.3", "typescript": "^5.9.3",
"vitest": "^4.1.5" "vitest": "^4.1.5",
"wrangler": "^4.85.0"
} }
} }