www-new/.drone.yml

96 lines
1.6 KiB
YAML
Raw Normal View History

---
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
2022-08-07 19:35:56 -04:00
- 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:
2022-08-07 19:35:56 -04:00
- 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'
2021-09-11 15:59:11 -04:00
- chmod 600 /tmp/ssh_key
2021-09-11 16:21:49 -04:00
- 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