88 lines
2.1 KiB
YAML
Raw Normal View History

2022-03-25 11:10:14 +01:00
pipeline:
2022-03-27 20:24:53 +02:00
generate_docker_tag:
2022-03-25 12:21:26 +01:00
image: golang
commands:
- echo -n "${CI_COMMIT_BRANCH//\//-}-${CI_COMMIT_SHA:0:8}, latest" > .tags
2022-03-27 20:24:53 +02:00
when:
2022-04-05 08:34:11 +02:00
path: [ "frontend/**", "telegram_bot/**", "api/**" ]
2022-03-27 20:24:53 +02:00
event: push
# -------------------------------------- API --------------------------------------
2022-03-25 12:21:26 +01:00
build_api:
image: woodpeckerci/plugin-docker-buildx
settings:
2022-04-05 08:34:11 +02:00
repo:
2022-03-25 12:21:26 +01:00
from_secret: repo_api
username:
from_secret: username
password:
from_secret: password
registry:
from_secret: registry
dockerfile: api/Dockerfile
platforms: linux/amd64
2022-03-27 10:08:43 +02:00
when:
2022-04-04 16:07:22 +02:00
path: "api/**"
2022-03-27 20:24:53 +02:00
event: push
2022-03-27 10:08:43 +02:00
2022-03-25 11:20:35 +01:00
2022-03-27 20:24:53 +02:00
# -------------------------------------- Bot --------------------------------------
2022-03-25 12:21:26 +01:00
build_bot:
image: woodpeckerci/plugin-docker-buildx
settings:
2022-04-05 08:34:11 +02:00
repo:
2022-03-25 12:21:26 +01:00
from_secret: repo_bot
username:
from_secret: username
password:
from_secret: password
registry:
from_secret: registry
dockerfile: telegram_bot/Dockerfile
platforms: linux/amd64
2022-03-27 10:08:43 +02:00
when:
2022-04-04 16:07:22 +02:00
path: "telegram_bot/**"
2022-04-04 15:35:16 +02:00
event: push
2022-03-27 10:08:43 +02:00
2022-03-27 20:24:53 +02:00
# -------------------------------------- Frontend --------------------------------------
2022-03-25 12:21:26 +01:00
build_frontend:
image: woodpeckerci/plugin-docker-buildx
settings:
2022-04-05 08:34:11 +02:00
repo:
2022-03-25 12:21:26 +01:00
from_secret: repo_frontend
username:
from_secret: username
password:
from_secret: password
registry:
from_secret: registry
dockerfile: frontend/Dockerfile
platforms: linux/amd64
2022-03-27 10:08:43 +02:00
when:
2022-04-04 16:07:22 +02:00
path: "frontend/**"
2022-04-04 15:35:16 +02:00
event: push
# -------------------------------------- Deploy --------------------------------------
deploy:
2022-03-25 12:09:57 +01:00
image: appleboy/drone-ssh
network_mode: host
2022-03-25 12:20:56 +01:00
settings:
2022-03-25 12:18:40 +01:00
host:
2022-03-25 12:09:57 +01:00
from_secret: ssh_host
2022-03-25 12:18:40 +01:00
username:
2022-03-25 12:09:57 +01:00
from_secret: ssh_user
2022-03-25 12:18:40 +01:00
password:
2022-03-25 12:09:57 +01:00
from_secret: ssh_password
2022-03-25 12:20:56 +01:00
script:
2022-04-04 16:02:44 +02:00
- cd /root/docker/aktienbot
- docker-compose pull
2022-04-04 16:03:48 +02:00
- docker-compose -p "aktienbot" up -d
2022-04-05 08:45:30 +02:00
when:
path: [ "frontend/**", "telegram_bot/**", "api/**" ]
event: push
2022-04-05 08:34:11 +02:00
2022-03-25 12:09:57 +01:00
branches: main