liste-de-courses-www/.drone.yml

96 lines
1.7 KiB
YAML
Raw Permalink Normal View History

kind: pipeline
type: docker
2023-10-20 19:16:12 +00:00
name: build
steps:
2022-08-06 14:04:21 +00:00
- name: lintAndBuild
image: node:14
commands:
- npm install
- npm run lint
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
2022-08-06 13:35:54 +00:00
2022-08-06 14:04:21 +00:00
- name: saveNodeModules
2022-08-06 13:35:54 +00:00
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- ./node_modules
2022-08-06 13:53:09 +00:00
cache_key: [ DRONE_REPO_NAME, DRONE_BRANCH ]
2022-08-06 13:35:54 +00:00
2022-08-06 13:05:16 +00:00
trigger:
event:
- push
- pull_request
2022-08-06 13:35:54 +00:00
volumes:
- name: cache
host:
path: /tmp/cache
2022-08-06 13:05:16 +00:00
---
kind: pipeline
type: docker
2022-08-06 13:53:09 +00:00
name: Deploy
2022-08-06 13:05:16 +00:00
steps:
2022-08-06 14:04:21 +00:00
- name: getNodeModules
2022-08-06 13:35:54 +00:00
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- ./node_modules
2022-08-06 13:53:09 +00:00
cache_key: [ DRONE_REPO_NAME, DRONE_BRANCH ]
2022-08-06 13:35:54 +00:00
2022-08-06 13:13:04 +00:00
- name: build
image: node:14
commands:
- npm run build:prod
environment:
VUE_APP_API_BASE_URL:
from_secret: baseurl
2022-08-06 14:04:21 +00:00
- name: scpFiles
image: appleboy/drone-scp
settings:
host: amine-louveau.fr
username: ubuntu
key:
from_secret: privateKey
port: 22
target: /home/ubuntu/courses
source: dist/*
2022-08-06 13:05:16 +00:00
2022-08-06 13:53:09 +00:00
- name: deploy
image: appleboy/drone-ssh
settings:
host: amine-louveau.fr
user: ubuntu
key:
2022-08-06 14:04:21 +00:00
from_secret: privateKey
2022-08-06 13:53:09 +00:00
command_timeout: 2m
script:
- cd /home/ubuntu/courses
- mv dist/* ./
- sudo chown www-data:www-data ./*
- sudo rm -rf /var/www/amine/courses/*
- sudo mv ./* /var/www/amine/courses/
2022-08-06 13:24:47 +00:00
trigger:
event:
- promote
target:
- production
2022-08-06 13:58:09 +00:00
volumes:
- name: cache
host:
path: /tmp/cache