2021-06-29 15:08:05 -04:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2021-08-08 18:14:09 -04:00
|
|
|
name: node16
|
2021-06-29 15:08:05 -04:00
|
|
|
|
|
|
|
steps:
|
2021-08-24 14:42:57 -04:00
|
|
|
- name: check-lockfile
|
|
|
|
image: node:16
|
|
|
|
commands:
|
|
|
|
- node ./check-lockfile.js
|
|
|
|
|
2021-06-29 15:08:05 -04:00
|
|
|
- name: install-deps
|
2021-08-08 18:14:09 -04:00
|
|
|
image: node:16
|
2021-08-24 14:42:57 -04:00
|
|
|
depends_on:
|
|
|
|
- check-lockfile
|
2021-06-29 15:08:05 -04:00
|
|
|
commands:
|
|
|
|
- npm install
|
|
|
|
|
|
|
|
- name: lint
|
2021-08-08 18:14:09 -04:00
|
|
|
image: node:16
|
2021-06-29 15:08:05 -04:00
|
|
|
depends_on:
|
|
|
|
- install-deps
|
|
|
|
commands:
|
|
|
|
- npm run lint
|
|
|
|
|
|
|
|
- name: build
|
2021-08-08 18:14:09 -04:00
|
|
|
image: node:16
|
2021-06-29 15:08:05 -04:00
|
|
|
depends_on:
|
|
|
|
- install-deps
|
|
|
|
commands:
|
|
|
|
- npm run build
|
|
|
|
|
|
|
|
- name: export
|
2021-08-08 18:14:09 -04:00
|
|
|
image: node:16
|
2021-06-29 15:08:05 -04:00
|
|
|
depends_on:
|
|
|
|
- build
|
|
|
|
commands:
|
|
|
|
- npm run export
|
|
|
|
|
2021-08-23 13:50:43 -04:00
|
|
|
- name: deploy (staging)
|
|
|
|
image: node:16
|
|
|
|
depends_on:
|
|
|
|
- export
|
|
|
|
environment:
|
|
|
|
TOKEN:
|
|
|
|
from_secret: STAGING_TOKEN
|
|
|
|
commands:
|
2021-08-25 00:24:53 -04:00
|
|
|
- 'curl -XPOST -H "Authorization: $TOKEN" -H "X-Branch: $DRONE_BRANCH" "https://csclub.uwaterloo.ca/~a3thakra/update-csc/"'
|
2021-09-11 15:24:19 -04:00
|
|
|
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'
|
2021-09-11 15:37:06 -04:00
|
|
|
- ssh -i /tmp/ssh_key www@caffeine.csclub.uwaterloo.ca -o StrictHostKeyChecking=no '~/bin/deploy-website.sh'
|
2021-09-11 15:24:19 -04:00
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- main
|
2021-08-23 13:50:43 -04:00
|
|
|
|
2021-06-29 15:08:05 -04:00
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
exclude:
|
2021-09-11 15:24:19 -04:00
|
|
|
- pull_request #avoid double build on PRs
|