VCinema/.drone.yml

49 lines
1.3 KiB
YAML

kind: pipeline
type: docker
name: deploy
steps:
- name: build
image: node:lts
commands:
- npm install
- npm run build --production
- name: deploy
image: alpine
when:
branch:
- master
environment:
USERNAME:
from_secret: ftp_username
PASSWORD:
from_secret: ftp_password
APIKEY:
from_secret: api_key
commands:
- apk --no-cache add lftp curl
- cd dist
- 'curl -X DELETE -H "AccessKey: $PASSWORD" https://storage.bunnycdn.com/vcinemaapp/'
- 'lftp -e "mirror -P 10 -R" -u $USERNAME,$PASSWORD storage.bunnycdn.com'
- 'curl -X POST -H "AccessKey: $APIKEY" https://bunnycdn.com/api/pullzone/233440/purgeCache --data ""'
- name: deploy-staging
image: alpine
when:
branch:
- develop
environment:
USERNAME:
from_secret: staging_ftp_username
PASSWORD:
from_secret: staging_ftp_password
APIKEY:
from_secret: api_key
commands:
- apk --no-cache add lftp curl
- cd dist
- 'curl -X DELETE -H "AccessKey: $PASSWORD" https://storage.bunnycdn.com/vcinemaapp/'
- 'lftp -e "mirror -P 10 -R" -u $USERNAME,$PASSWORD storage.bunnycdn.com'
- 'curl -X POST -H "AccessKey: $APIKEY" https://bunnycdn.com/api/pullzone/244774/purgeCache --data ""'