Compare commits

...

2 Commits

Author SHA1 Message Date
eabd5b39a7 Remove the need for master branch only
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Signed-off-by: Noah Knegt <git@noahknegt.com>
2023-03-31 10:12:48 +02:00
05c20a67e9 Fix and test ssh key
Signed-off-by: Noah Knegt <git@noahknegt.com>
2023-03-31 10:12:29 +02:00

View File

@@ -17,24 +17,31 @@ steps:
- name: setup ssh key - name: setup ssh key
image: alpine:latest image: alpine:latest
commands: commands:
- mkdir -p /drone/src/.ssh - mkdir -p $HOME/.ssh
- echo "$SSH_KEY" > /drone/src/.ssh/id_ed25519 - echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
- chmod 600 /drone/src/.ssh/id_ed25519 - chmod 600 $HOME/.ssh/id_ed25519
- ssh-keyscan -p 4422 vps.noahknegt.com > $HOME/.ssh/known_hosts
- ssh -p 4422 vps.noahknegt.com "echo 'SSH connection established'"
environment: environment:
SSH_KEY: SSH_KEY:
from_secret: ssh_key from_secret: ssh_key
volumes:
- name: ssh_key
path: $HOME/.ssh
- name: ansible apply
image: cytopia/ansible:latest-tools
commands:
- ansible-playbook -i inventory/hosts.yml site.yml
volumes:
- name: ssh_key
path: $HOME/.ssh
when: when:
event: event:
- push - push
branch: branch:
- master - master
- name: ansible apply volumes:
image: cytopia/ansible:latest-tools - name: ssh_key
commands: temp: {}
- ansible-playbook -i inventory/hosts.yml site.yml --private-key /drone/src/.ssh/id_ed25519
when:
event:
- push
branch:
- master