103 lines
1.9 KiB
YAML
103 lines
1.9 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: seasoned build
|
|
|
|
platform:
|
|
os: linux
|
|
arch: amd64
|
|
|
|
volumes:
|
|
- name: cache
|
|
host:
|
|
path: /tmp/cache
|
|
|
|
steps:
|
|
- name: Load cached frontend packages
|
|
image: sinlead/drone-cache:1.0.0
|
|
settings:
|
|
action: load
|
|
key: yarn.lock
|
|
mount: node_modules
|
|
prefix: yarn-modules-seasoned
|
|
volumes:
|
|
- name: cache
|
|
path: /cache
|
|
|
|
- name: Frontend install
|
|
image: node:18.2.0
|
|
commands:
|
|
- node -v
|
|
- yarn --version
|
|
- yarn
|
|
|
|
- name: Cache frontend packages
|
|
image: sinlead/drone-cache:1.0.0
|
|
settings:
|
|
action: save
|
|
key: yarn.lock
|
|
mount: node_modules
|
|
prefix: yarn-modules-seasoned
|
|
volumes:
|
|
- name: cache
|
|
path: /cache
|
|
|
|
- name: Frontend build
|
|
image: node:18.2.0
|
|
commands:
|
|
- yarn build
|
|
environment:
|
|
ELASTIC:
|
|
from_secret: ELASTIC
|
|
ELASTIC_INDEX:
|
|
from_secret: ELASTIC_INDEX
|
|
SEASONED_API:
|
|
from_secret: SEASONED_API
|
|
SEASONED_DOMAIN:
|
|
from_secret: SEASONED_DOMAIN
|
|
|
|
- name: Lint project using eslint
|
|
image: node:18.2.0
|
|
commands:
|
|
- yarn lint
|
|
failure: ignore
|
|
|
|
- name: Build and publish docker image
|
|
image: plugins/docker
|
|
settings:
|
|
registry: ghcr.io
|
|
repo: ghcr.io/kevinmidboe/seasoned
|
|
dockerfile: Dockerfile
|
|
username:
|
|
from_secret: GITHUB_USERNAME
|
|
password:
|
|
from_secret: GITHUB_PASSWORD
|
|
tags: latest
|
|
|
|
- name: deploy
|
|
image: appleboy/drone-ssh
|
|
pull: true
|
|
secrets:
|
|
- ssh_key
|
|
when:
|
|
event:
|
|
- push
|
|
branch:
|
|
- master
|
|
- drone-test
|
|
status: success
|
|
settings:
|
|
host: 10.0.0.114
|
|
username: root
|
|
key:
|
|
from_secret: ssh_key
|
|
command_timeout: 600s
|
|
script:
|
|
- /home/kevin/deploy/seasoned.sh
|
|
|
|
trigger:
|
|
event:
|
|
include:
|
|
- push
|
|
# - pull_request
|