73 lines
1.2 KiB
YAML
73 lines
1.2 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: node16
|
|
|
|
steps:
|
|
- name: check-lockfile
|
|
image: node:16
|
|
commands:
|
|
- node ./check-lockfile.js
|
|
|
|
- name: install-deps
|
|
image: node:16
|
|
depends_on:
|
|
- check-lockfile
|
|
commands:
|
|
- npm install
|
|
|
|
- name: lint
|
|
image: node:16
|
|
depends_on:
|
|
- install-deps
|
|
commands:
|
|
- npm run lint
|
|
|
|
- name: build
|
|
image: node:16
|
|
depends_on:
|
|
- install-deps
|
|
commands:
|
|
- npm run build
|
|
|
|
- name: export
|
|
image: node:16
|
|
depends_on:
|
|
- build
|
|
commands:
|
|
- npm run export
|
|
|
|
- name: deploy (staging)
|
|
image: node:16
|
|
depends_on:
|
|
- export
|
|
environment:
|
|
TOKEN:
|
|
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'
|
|
- chmod 600 /tmp/ssh_key
|
|
- ssh -i /tmp/ssh_key www@caffeine.csclub.uwaterloo.ca -o StrictHostKeyChecking=no '~/bin/deploy-website.sh'
|
|
when:
|
|
branch:
|
|
- main
|
|
|
|
trigger:
|
|
event:
|
|
exclude:
|
|
- pull_request #avoid double build on PRs
|