add ci
All checks were successful
continuous-integration/drone Build is passing

add vercel deploy for web
This commit is contained in:
Enrico Bühler 2023-06-25 21:58:16 +02:00
parent 74f7274a7e
commit 7385b7ba41
3 changed files with 27 additions and 0 deletions

17
.drone.yml Normal file
View File

@ -0,0 +1,17 @@
kind: pipeline
name: web
type: docker
steps:
- name: deploy web
image: node:alpine
environment:
IS_PROD: true
TOKEN:
from_secret: VERCEL_TOKEN
when:
branch:
- main
commands:
- npm install -g vercel@latest
- /bin/sh ./web/deploy.sh

1
web/.vercel/project.json Normal file
View File

@ -0,0 +1 @@
{"orgId":"c0DV5ATsGbVZoMVVr9msnlC7","projectId":"prj_6wyilH72l9zcNlIfA9NUAJ0xON0v"}

9
web/deploy.sh Normal file
View File

@ -0,0 +1,9 @@
[ -z $TOKEN ] && printf "Token is missing" && exit 1
if [ -z $IS_PROD ]; then
printf "\nTEST DEPLOYMENT\n"
else
printf "\nPRODUCTION DEPLOYMENT\n" && PROD="--prod"
fi
URL=$(vercel --yes --global-config ./.vercel --token $TOKEN $PROD) && printf "\nDEPLOYMENT SUCCESSFUL\n$URL"