Computer Science Club of the University of Waterloo's website. https://csclub.uwaterloo.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

95 lines
1.6 KiB

---
kind: pipeline
type: docker
name: node16
steps:
- name: install-deps
image: node:16
commands:
- npm install
- name: check-lockfile
image: node:16
depends_on:
- install-deps
commands:
- npm run check-lockfile
- name: lint
image: node:16
depends_on:
- install-deps
commands:
- npm run lint
- name: optimize-images
image: node:16
depends_on:
- install-deps
commands:
- npm run build:images
- name: generate-calendar
image: node:16
depends_on:
- install-deps
commands:
- npm run build:calendar
- name: generate-api
image: node:16
depends_on:
- install-deps
commands:
- npm run build:api
- name: build
image: node:16
depends_on:
- optimize-images
commands:
- USE_LDAP=true npm run build:web
- name: export
image: node:16
depends_on:
- generate-api
- generate-calendar
- 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 -4 -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