2023-11-25 19:38:13 +01:00
|
|
|
steps:
|
2023-07-16 19:34:52 +02:00
|
|
|
build-stable:
|
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
|
|
commands:
|
|
|
|
- hugo --destination /woodpecker/build/ --minify --cleanDestinationDir
|
2025-02-18 18:09:28 +01:00
|
|
|
volumes:
|
|
|
|
- /srv/woodpecker-cache/cozy.town:/woodpecker/src/code.cozy.town/cozytown/website/resources/_gen
|
2023-07-16 19:34:52 +02:00
|
|
|
when:
|
2025-02-18 18:09:28 +01:00
|
|
|
- branch: main
|
|
|
|
event: [push, pull_request_closed, manual]
|
2023-07-16 19:34:52 +02:00
|
|
|
|
2025-02-18 18:09:28 +01:00
|
|
|
build-dev:
|
2023-07-16 19:34:52 +02:00
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
|
|
commands:
|
2025-02-18 18:47:37 +01:00
|
|
|
- hugo --destination /woodpecker/build/ --baseURL "https://dev.cozy.town/" --cleanDestinationDir
|
2025-02-18 18:09:28 +01:00
|
|
|
volumes:
|
|
|
|
- /srv/woodpecker-cache/cozy.town:/woodpecker/src/code.cozy.town/cozytown/website/resources/_gen
|
2023-07-16 19:34:52 +02:00
|
|
|
when:
|
2025-02-18 18:09:28 +01:00
|
|
|
- branch:
|
|
|
|
exclude: main
|
|
|
|
event: [push, pull_request, manual]
|
2023-07-16 19:34:52 +02:00
|
|
|
|
2025-02-18 18:09:28 +01:00
|
|
|
upload-stable:
|
2023-07-16 19:34:52 +02:00
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
|
|
commands:
|
2025-02-18 18:09:28 +01:00
|
|
|
- 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/cozy.town/ --mkpath --checksum
|
|
|
|
environment:
|
|
|
|
DEPLOY_BOT_SSH_KEY:
|
|
|
|
from_secret: deploy_bot_ssh_key
|
2023-07-16 19:34:52 +02:00
|
|
|
when:
|
2025-02-18 18:09:28 +01:00
|
|
|
- branch: main
|
|
|
|
event: [push, pull_request_closed, manual]
|
2023-07-16 19:34:52 +02:00
|
|
|
|
|
|
|
upload-dev:
|
|
|
|
image: code.cozy.town/vrifox/hugoci:latest
|
|
|
|
commands:
|
|
|
|
- mkdir -p /root/.ssh
|
2025-02-18 18:09:28 +01:00
|
|
|
- echo "$${DEPLOY_BOT_SSH_KEY}" > /root/.ssh/id_ed25519
|
|
|
|
- chmod 400 /root/.ssh/id_ed25519
|
2023-07-16 19:34:52 +02:00
|
|
|
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
|
2025-02-18 18:09:28 +01:00
|
|
|
- rsync -rv --delete -e "ssh -p 42842 -i /root/.ssh/id_ed25519" /woodpecker/build/ deploy-bot@cozytown-main.cozy.town:/srv/http/dev.cozy.town/ --mkpath --checksum
|
|
|
|
- echo "The preview is now available on https://dev.cozy.town/"
|
|
|
|
environment:
|
|
|
|
DEPLOY_BOT_SSH_KEY:
|
|
|
|
from_secret: deploy_bot_ssh_key
|
2023-07-16 19:34:52 +02:00
|
|
|
when:
|
2025-02-18 18:09:28 +01:00
|
|
|
- branch:
|
|
|
|
exclude: main
|
|
|
|
event: [push, pull_request, manual]
|