personal-website/.woodpecker/deploy-netlify.yaml

37 lines
981 B
YAML
Raw Normal View History

2023-08-08 09:03:06 +02:00
steps:
build:
image: golang:1.20-bookworm
2023-08-08 09:13:04 +02:00
environment:
- HUGO_VERSION=0.117.0
2023-08-08 09:03:06 +02:00
when:
- event: push
branch: [main, staging]
commands:
2023-08-08 09:13:53 +02:00
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb
2023-08-08 09:03:06 +02:00
- hugo --minify --destination ./public
2023-08-08 09:13:04 +02:00
2023-08-08 09:03:06 +02:00
deploy-staging:
image: node:alpine
when:
- event: push
branch: staging
secrets:
- NETLIFY_AUTH_TOKEN
- NETLIFY_SITE_ID
commands:
- npm install netlify-cli -g
- netlify deploy --alias stage --dir ./public
deploy-production:
image: node:alpine
when:
- event: push
branch: main
secrets:
- NETLIFY_AUTH_TOKEN
- NETLIFY_SITE_ID
commands:
- npm install netlify-cli -g
- netlify deploy --prod --dir ./public