You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

98 lines
2.0 KiB

kind: pipeline
name: default
workspace:
base: /go
path: src/p83.nl/go/wiki
steps:
- name: testing
image: golang:1.13-alpine
commands:
- export GOPATH=/go
- export CGO_ENABLED=0
- apk --no-cache add git
- go get -d -t ./...
- go build ./...
- go test ./...
- name: restore-cache-with-filesystem
image: meltwater/drone-cache:v1
pull: true
settings:
backend: "filesystem"
restore: true
cache_key: '{{ .Repo.Name }}_{{ arch }}_{{ os }}'
archive_format: "gzip"
mount:
- './editor/node_modules'
volumes:
- name: cache
path: /tmp/cache
- name: build-node
image: node:14
depends_on:
- restore-cache-with-filesystem
commands:
- cd list-editor
- npm install
- cd ../editor
- npm install
- npm run docker
- name: rebuild-cache-with-filesystem
image: meltwater/drone-cache:v1
pull: true
depends_on:
- build-node
settings:
backend: "filesystem"
rebuild: true
cache_key: '{{ .Repo.Name }}_{{ arch }}_{{ os }}'
archive_format: "gzip"
mount:
- './editor/node_modules'
volumes:
- name: cache
path: /tmp/cache
- name: publish
image: plugins/docker
depends_on:
- rebuild-cache-with-filesystem
- testing
settings:
repo: registry.stuifzandapp.com/wiki
registry: registry.stuifzandapp.com
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: deploy
image: appleboy/drone-ssh
depends_on:
- publish
settings:
host: wiki.p83.nl
username: wiki
ssh_key:
from_secret: ssh_key
script:
- cd /home/wiki/wiki
- docker-compose pull web
- docker-compose up -d
# - name: notify
# image: plugins/webhook
# settings:
# debug: true
# secrets:
# - source: result_webhook
# target: plugin_urls
volumes:
- name: cache
host:
path: /cache