writekit/.woodpecker/build.yaml
Josh c662e41b97
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Disable CDN caching for HTML, add Quicklink prefetching
- Change Cache-Control from s-maxage=31536000 to max-age=0,must-revalidate
  for all HTML pages and sitemap (fixes stale content after settings change)
- Remove Cloudflare PurgeURLs call since we're not caching HTML at CDN
- Add Quicklink for client-side prefetching on public blog pages
- Make main branch deploy automatic (remove manual trigger)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 22:02:47 +02:00

45 lines
1.4 KiB
YAML

when:
branch: [main, dev]
event: push
steps:
- name: test
image: golang:1.24-alpine
commands:
- go test -tags testing ./...
volumes:
- /tmp/go-cache:/go/pkg/mod
- name: build
image: docker:27-cli
environment:
DOCKER_HOST: unix:///var/run/docker.sock
commands:
- docker build -t 10.0.0.3:5000/writekit:${CI_COMMIT_BRANCH} .
- docker push 10.0.0.3:5000/writekit:${CI_COMMIT_BRANCH}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- name: deploy-staging
image: alpine
when:
branch: dev
commands:
- apk add --no-cache openssh-client
- mkdir -p ~/.ssh
- cp /mnt/ssh/deploy_key ~/.ssh/id_ed25519
- cp /mnt/ssh/known_hosts ~/.ssh/known_hosts
- chmod 600 ~/.ssh/id_ed25519
- ssh deploy@10.0.0.2 "cd /opt/writekit && set -a && . .env && set +a && docker compose pull writekit-staging && docker compose up -d writekit-staging"
- name: deploy-prod
image: alpine
when:
branch: main
commands:
- apk add --no-cache openssh-client
- mkdir -p ~/.ssh
- cp /mnt/ssh/deploy_key ~/.ssh/id_ed25519
- cp /mnt/ssh/known_hosts ~/.ssh/known_hosts
- chmod 600 ~/.ssh/id_ed25519
- ssh deploy@10.0.0.2 "cd /opt/writekit && set -a && . .env && set +a && docker compose pull writekit-prod && docker compose up -d writekit-prod"