From a0608fc4538d6a24a716901df36e39b013b6bfd5 Mon Sep 17 00:00:00 2001 From: shahanneda Date: Fri, 30 Dec 2022 20:12:41 -0500 Subject: [PATCH] Setup deploy on main --- .drone.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9a2840d..39c3a0e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,7 +50,7 @@ steps: registry: registry.cloud.csclub.uwaterloo.ca repo: registry.cloud.csclub.uwaterloo.ca/snedadah/csc-class-profile-staging -- name: deploy +- name: deploy (staging) image: node:16 depends_on: - publish @@ -60,7 +60,22 @@ steps: commands: - echo "The docker build tag is ${DRONE_BRANCH//\//-}" - 'curl -H "Authorization: $STAGING_AUTH_TOKEN" https://csclub.uwaterloo.ca/~snedadah/webhooks/cscclassprofilestaging?ref=${DRONE_BRANCH//\//-}' - + +- name: deploy (production) + image: node:16 + depends_on: + - export + environment: + SSH_KEY: + from_secret: DEPLOYMENT_SSH_KEY + commands: + - 'echo "$SSH_KEY" > /tmp/ssh_key' + - chmod 600 /tmp/ssh_key + - ssh -4 -i /tmp/ssh_key www@caffeine.csclub.uwaterloo.ca -o StrictHostKeyChecking=no '~/bin/classprofile/deploy-classprofile-2022.sh' + when: + branch: + - main + trigger: event: exclude: