[SKIP CI] use less annoying clone

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-11-17 15:44:58 +01:00
parent aea854beec
commit b24d8aa47d
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
2 changed files with 31 additions and 45 deletions

View file

@ -2,36 +2,39 @@ kind: pipeline
type: docker
name: Deploy
clone:
disable: true
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
- name: Clone
image: woodpeckerci/plugin-git
settings:
recursive: true
- name: Build
depends_on:
- submodules
image: node:16
commands:
- yarn
- yarn build
when:
event:
- push
- name: Build
depends_on:
- submodules
image: node:16
commands:
- yarn
- yarn build
when:
event:
- push
- name: Execute deploy script
depends_on:
- Build
image: ubuntu:latest
environment:
- name: Execute deploy script
depends_on:
- Build
image: ubuntu:latest
environment:
SSH_KEY:
from_secret: SSH_KEY
commands:
- apt update && apt install -y openssh-client rsync
- ./ci/add-key.sh
- ./ci/deploy.sh
when:
event:
- push
branch:
- froth
commands:
- apt update && apt install -y openssh-client rsync
- ./ci/add-key.sh
- ./ci/deploy.sh
when:
event:
- push
branch:
- froth

View file

@ -1,17 +0,0 @@
#!/bin/sh
# only execute this script as part of the pipeline.
[ -z "$CI" ] && echo "missing ci environment variable" && exit 2
# only execute the script when github token exists.
[ -z "$SSH_KEY" ] && echo "missing ssh key" && exit 3
# write the ssh key.
mkdir /root/.ssh
echo -n "${SSH_KEY}" > /root/.ssh/id_ed25519
chmod 600 /root/.ssh/id_ed25519
# add froth.zone to our known hosts.
touch /root/.ssh/known_hosts
chmod 600 /root/.ssh/known_hosts
ssh-keyscan -H froth.zone > /etc/ssh/ssh_known_hosts 2> /dev/null