deblan.io-murph/.woodpecker/deploy.yml

26 lines
689 B
YAML
Raw Normal View History

2023-09-22 22:07:17 +02:00
variables:
2023-12-06 20:20:10 +01:00
volumes: &volumes
2023-11-10 11:30:05 +01:00
- /data/${CI_REPO}:/builds
2023-09-22 22:07:17 +02:00
when:
event: [deployment]
2023-10-13 00:05:15 +02:00
skip_clone: true
2023-09-29 16:02:54 +02:00
steps:
2023-09-22 22:07:17 +02:00
app-deploy:
2023-10-18 22:07:20 +02:00
image: deblan/mage
2024-01-10 10:08:20 +01:00
secrets: [ssh_priv_key, ssh_user, ssh_host, app_directory]
2023-09-22 22:07:17 +02:00
volumes: *volumes
commands:
2023-10-18 22:07:20 +02:00
- cd "/builds/$CI_COMMIT_SHA"
2023-09-22 22:07:17 +02:00
- mkdir "$HOME/.ssh"
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
- chmod 700 "$HOME/.ssh"
- chmod 600 "$HOME/.ssh/id_ed25519"
- cp .mage.yml.dist .mage.yml
- sed -i "s/ssh_user/$SSH_USER/g" .mage.yml
- sed -i "s/ssh_host/$SSH_HOST/g" .mage.yml
- sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml
2023-10-18 22:07:55 +02:00
- mage deploy "$CI_PIPELINE_DEPLOY_TARGET"