2021-01-03 05:20:19 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: deploy
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
2021-01-03 05:30:27 +00:00
|
|
|
image: node:lts
|
2021-01-03 05:20:19 +00:00
|
|
|
commands:
|
|
|
|
- npm install
|
2021-01-05 04:08:45 +00:00
|
|
|
- npm run build --production
|
2021-01-03 05:20:19 +00:00
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
image: alpine
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
environment:
|
|
|
|
USERNAME:
|
|
|
|
from_secret: ftp_username
|
|
|
|
PASSWORD:
|
|
|
|
from_secret: ftp_password
|
2021-01-03 19:26:28 +00:00
|
|
|
APIKEY:
|
|
|
|
from_secret: api_key
|
2021-01-03 05:20:19 +00:00
|
|
|
commands:
|
2021-01-03 05:33:35 +00:00
|
|
|
- apk --no-cache add lftp curl
|
2021-01-03 05:30:27 +00:00
|
|
|
- cd dist
|
2021-01-03 05:33:35 +00:00
|
|
|
- 'curl -X DELETE -H "AccessKey: $PASSWORD" https://storage.bunnycdn.com/vcinemaapp/'
|
|
|
|
- 'lftp -e "mirror -P 10 -R" -u $USERNAME,$PASSWORD storage.bunnycdn.com'
|
2021-01-03 19:26:28 +00:00
|
|
|
- 'curl -X POST -H "AccessKey: $APIKEY" https://bunnycdn.com/api/pullzone/233440/purgeCache --data ""'
|
2021-01-18 19:55:28 +00:00
|
|
|
|
|
|
|
- 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 ""'
|