ploughshares/.woodpecker.yml

55 lines
1.4 KiB
YAML

steps:
- name: build
image: woodpeckerci/plugin-docker-buildx
settings:
repo: registry.example.com/ploughshares
registry: registry.example.com
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- latest
- "${CI_COMMIT_TAG##v}"
- "${CI_COMMIT_BRANCH}"
dockerfile: docker/ploughshares/Dockerfile
platforms:
- linux/amd64
- linux/arm64
when:
event: [push, tag]
branch: [main, master]
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_username
key:
from_secret: ssh_key
port: 22
script:
- cd /path/to/deployment
- docker stack deploy -c stack.production.yml ploughshares
when:
event: [push, tag]
branch: [main, master]
- name: notify
image: plugins/slack
settings:
webhook:
from_secret: slack_webhook
channel: deployments
template: >
{{#success build.status}}
Build {{build.number}} succeeded. Project Ploughshares has been deployed successfully.
{{else}}
Build {{build.number}} failed. Please check the logs for more details.
{{/success}}
when:
status: [success, failure]
event: [push, tag]
branch: [main, master]