53 lines
2 KiB
YAML
53 lines
2 KiB
YAML
steps:
|
|
build-stable:
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
commands:
|
|
- hugo --destination /woodpecker/build/ --minify --cleanDestinationDir
|
|
volumes:
|
|
- /srv/woodpecker-cache/vrifox.cc:/woodpecker/src/code.cozy.town/vrifox/website/resources/_gen
|
|
when:
|
|
- branch: main
|
|
event: [push, pull_request_closed, manual]
|
|
|
|
build-dev:
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
commands:
|
|
- hugo --destination /woodpecker/build/ --baseURL "https://dev.vrifox.cc/" --cleanDestinationDir
|
|
volumes:
|
|
- /srv/woodpecker-cache/vrifox.cc:/woodpecker/src/code.cozy.town/vrifox.cc/website/resources/_gen
|
|
when:
|
|
- branch:
|
|
exclude: main
|
|
event: [push, pull_request, manual]
|
|
|
|
upload-stable:
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
commands:
|
|
- mkdir -p /root/.ssh
|
|
- echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519
|
|
- chmod 400 /root/.ssh/id_ed25519
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
|
- rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@$cozytown-main.cozy.town:/srv/http/vrifox.cc/ --mkpath --checksum
|
|
environment:
|
|
DEPLOY_BOT_SSH_KEY:
|
|
from_secret: deploy_bot_ssh_key
|
|
when:
|
|
- branch: main
|
|
event: [push, pull_request_closed, manual]
|
|
|
|
upload-dev:
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
commands:
|
|
- mkdir -p /root/.ssh
|
|
- echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519
|
|
- chmod 400 /root/.ssh/id_ed25519
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
|
- rsync -rv --delete -e "ssh -p 42824 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@cozytown-main.cozy.town:/srv/http/vrifox.cc-dev/ --mkpath --checksum
|
|
- echo "The preview is now available on https://dev.vrifox.cc/"
|
|
environment:
|
|
DEPLOY_BOT_SSH_KEY:
|
|
from_secret: deploy_bot_ssh_key
|
|
when:
|
|
- branch:
|
|
exclude: main
|
|
event: [push, pull_request, manual]
|