memEx/.drone.yml
shibao 03890d2431
All checks were successful
continuous-integration/drone/push Build is passing
update drone
2022-11-27 01:18:04 -05:00

96 lines
1.9 KiB
YAML

kind: pipeline
type: docker
name: memex
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- _build
- deps
- assets/node_modules/
- name: test
image: elixir:1.14.1-alpine
environment:
TEST_DATABASE_URL: ecto://postgres:postgres@database/memex_test
HOST: testing.example.tld
commands:
- apk add --no-cache build-base npm git python3
- mix local.rebar --force
- mix local.hex --force
- mix deps.get
- mix deps.compile
- npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
- npm run --prefix ./assets deploy
- mix do phx.digest, gettext.extract
- mix test.all
- name: build and publish stable
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
repo: shibaobun/memex
purge: true
compress: true
platforms: linux/amd64,linux/arm/v7
username:
from_secret: docker_username
password:
from_secret: docker_password
tags: latest
when:
branch:
- stable
- name: build and publish tagged version
image: thegeeklab/drone-docker-buildx
privileged: true
settings:
repo: shibaobun/memex
purge: true
compress: true
platforms: linux/amd64,linux/arm/v7
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- ${DRONE_TAG}
when:
event:
- tag
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- _build
- deps
- assets/node_modules/
services:
- name: database
image: postgres:13
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
volumes:
- name: cache
host:
path: /run/media/default/ssdsrv/gitea/drone-cache
- name: docker_sock
host:
path: /var/run/docker.sock