29 lines
899 B
YAML
29 lines
899 B
YAML
# yaml-language-server: $schema=https://json.schemastore.org/drone.json
|
|
name: deploy
|
|
kind: pipeline
|
|
type: docker
|
|
node:
|
|
instance: system
|
|
trigger:
|
|
event:
|
|
- push
|
|
branch:
|
|
- main
|
|
steps:
|
|
- name: deploy
|
|
image: docker:23.0.1-cli-alpine3.17@sha256:6ea6ac10351a3f4670424cff8f43272bbc7e221a5692fc6ff1c46b3b717a09eb
|
|
commands:
|
|
- mkdir -p /root/.ssh
|
|
- install -v -m 600 /home/ubuntu/.ssh/id_ed25519 /root/.ssh/id_ed25519
|
|
- ssh-keyscan beta.fogtype.com >> /root/.ssh/known_hosts
|
|
- docker context create --docker=host=ssh://ubuntu@beta.fogtype.com beta
|
|
- docker context use beta
|
|
- docker compose --project-name=beta up --build --detach
|
|
- docker compose --project-directory=example up --detach
|
|
volumes:
|
|
- name: ssh_key
|
|
path: /home/ubuntu/.ssh/id_ed25519
|
|
volumes:
|
|
- name: ssh_key
|
|
host:
|
|
path: /home/ubuntu/.ssh/id_ed25519
|