add deployment step #310
20
.drone.yml
20
.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:
|
||||
a3thakra
commented
Can we somehow use the /deploy.sh script placed in this repository, just so that everything is in a single place? Can we somehow use the /deploy.sh script placed in this repository, just so that everything is in a single place?
a3thakra
commented
if not this is also fine :) if not this is also fine :)
merenber
commented
The contents of deploy-website.sh are just
The contents of deploy-website.sh are just
```sh
#!/bin/sh
curl -o- https://git.csclub.uwaterloo.ca/www/www-new/raw/branch/main/deploy.sh | bash
```
a3thakra
commented
if the contents of the file is a single line, why not inline that command here? if the contents of the file is a single line, why not inline that command here?
merenber
commented
It's because we have a It's because we have a `command` clause in the authorized_keys file for the www user.
|
||||
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
|
||||
- pull_request #avoid double build on PRs
|
||||
|
|
Loading…
Reference in New Issue
Can you add a condition here so it doesn't run on the main branch?