From a21e8f2f0c62630ef95e6040cfe2244e72f0b9ec Mon Sep 17 00:00:00 2001 From: Max Erenberg Date: Sat, 11 Sep 2021 15:24:19 -0400 Subject: [PATCH] add deployment step (#310) Closes #131. Reviewed-on: https://git.csclub.uwaterloo.ca/www/www-new/pulls/310 Co-authored-by: Max Erenberg Co-committed-by: Max Erenberg --- .drone.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 61536adf..220d808f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -46,8 +46,26 @@ steps: from_secret: STAGING_TOKEN commands: - 'curl -XPOST -H "Authorization: $TOKEN" -H "X-Branch: $DRONE_BRANCH" "https://csclub.uwaterloo.ca/~a3thakra/update-csc/"' + when: + branch: + exclude: + - main + +- name: deploy (production) + image: node:16 + depends_on: + - export + environment: + SSH_KEY: + from_secret: DEPLOYMENT_SSH_KEY + commands: + - 'echo "$SSH_KEY" > /tmp/ssh_key' + - ssh -i /tmp/ssh_key www@caffeine.csclub.uwaterloo.ca '~/bin/deploy-website.sh' + when: + branch: + - main trigger: event: exclude: - - pull_request #avoid double build on PRs \ No newline at end of file + - pull_request #avoid double build on PRs