cremeaux/.drone.yml

173 lines
4.3 KiB
YAML

---
# drone encrypt weko/cremeaux $DIRECTUS_URL
kind: secret
name: DIRECTUS_URL
data: ES7uXGzaLMrydnCpt7+IC2m2mCUbtrKN66hQzVuwJH/aSZFtRWlugAWSQEfdAGyuhgYuJCPouQ==
---
# drone encrypt weko/cremeaux $DIRECTUS_TOKEN
kind: secret
name: DIRECTUS_TOKEN
data: BBCI/bTmqZh9VlbVpSnT9ZI5BotPlQOpJeo8G60XILi4N910Fx4E5fSVaHlM/vnHDGr0rp/01NEHVfyU
---
# drone encrypt weko/cremeaux $AWS_ACCESS_KEY_ID
kind: secret
name: STAGING_AWS_ACCESS_KEY_ID
data: SieGQfPorTIJA3vr162NjnUZ3/RsK7YH2A3fw/UcyL3d5l+pYrlfSH6+E8JY7j1u0cxEowsU
---
# drone encrypt weko/cremeaux $AWS_SECRET_ACCESS_KEY
kind: secret
name: STAGING_AWS_SECRET_ACCESS_KEY
data: wtK0NBQL5ZovW/ElM2fHThZlF6Sxy/ZFydrwf7vj1iNjHodw2U7lIIBO5L8Cbns/+AiZJ1SQHLlRgVD8O6NvIAho8yCnhF/xm42zR+G6KpQJdZPNaUbOVKWlfEk=
---
# drone encrypt weko/cremeaux $AWS_ACCESS_KEY_ID
kind: secret
name: PRODUCTION_AWS_ACCESS_KEY_ID
data: Of3qL0gBgFRImSFgZtqxRUiwXgEveEC6YXwzwlFR2vxV3fxTX3FxGGYZZhtH/AmnOzLgB2F9
---
# drone encrypt weko/cremeaux $AWS_SECRET_ACCESS_KEY
kind: secret
name: PRODUCTION_AWS_SECRET_ACCESS_KEY
data: fCZeV+TBazRF7UAoRpyeKGQ0xvhzzbFp5vO7NXFsWu8IgHV/uD7fA0tQQYAqjKxu1OwTDitK/4rJQl20SGNqHw9X+pHWY4h2wDbOuhQD0L2VNIsuLpZcnipBbYA=
---
kind: pipeline
type: docker
name: prod
platform:
os: linux
arch: arm64
steps:
- name: install submodule
image: drone/git
commands:
- git submodule update --init
- name: install npm
image: node:current-alpine
volumes:
- name: hugo-theme-lowtech_node_modules
path: /drone/src/themes/hugo-theme-lowtech/node_modules
environment:
DIRECTUS_URL:
from_secret: DIRECTUS_URL
DIRECTUS_TOKEN:
from_secret: DIRECTUS_TOKEN
commands:
- (cd themes/hugo-theme-lowtech && npm i)
- node scripts/directus-to-markdown/index.js
- name: build website
image: klakegg/hugo:0.101.0-ext-debian-ci
volumes:
- name: hugo-resources
path: /drone/src/resources
commands:
- hugo --minify --environment production
- name: typo
image: node:current-alpine
volumes:
- name: hugo-theme-lowtech_node_modules
path: /drone/src/themes/hugo-theme-lowtech/node_modules
commands:
- node themes/hugo-theme-lowtech/scripts/typo
- name: deploy
image: klakegg/hugo:0.101.0-ext-debian-ci
environment:
AWS_ACCESS_KEY_ID:
from_secret: PRODUCTION_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: PRODUCTION_AWS_SECRET_ACCESS_KEY
commands:
- hugo deploy --environment production
- name: notify
image: plugins/matrix@sha256:f1affb31b0c86963c97c6f976fa0dcb3cc84272057fd8558d609d28b3064bd7f
settings:
homeserver: https://converser.eu
roomid: "QwOITmkKxRJJyCSDOZ:converser.eu"
userid: "resilien:converser.eu"
accesstoken:
from_secret: MATRIX_ACCESSTOKEN
when:
status: [ failure ]
volumes:
- name: hugo-theme-lowtech_node_modules
host:
path: /tmp/drone/cache/weko/cremeaux/themes/hugo-theme-lowtech
- name: hugo-resources
host:
path: /tmp/drone/cache/weko/cremeaux/resources
---
kind: pipeline
type: docker
name: staging
platform:
os: linux
arch: arm64
steps:
- name: install submodule
image: drone/git
commands:
- git submodule update --init
- name: install npm
image: node:current-alpine
volumes:
- name: hugo-theme-lowtech_node_modules
path: /drone/src/themes/hugo-theme-lowtech/node_modules
environment:
DIRECTUS_URL:
from_secret: DIRECTUS_URL
DIRECTUS_TOKEN:
from_secret: DIRECTUS_TOKEN
commands:
- (cd themes/hugo-theme-lowtech && npm i)
- DRAFT=true node scripts/directus-to-markdown/index.js
- name: build website
image: klakegg/hugo:0.101.0-ext-debian-ci
volumes:
- name: hugo-resources
path: /drone/src/resources
commands:
- hugo --minify --buildDrafts --buildFuture --environment staging
- name: typo
image: node:current-alpine
volumes:
- name: hugo-theme-lowtech_node_modules
path: /drone/src/themes/hugo-theme-lowtech/node_modules
commands:
- node themes/hugo-theme-lowtech/scripts/typo
- name: deploy
image: klakegg/hugo:0.101.0-ext-debian-ci
environment:
AWS_ACCESS_KEY_ID:
from_secret: STAGING_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY:
from_secret: STAGING_AWS_SECRET_ACCESS_KEY
commands:
- hugo deploy --environment staging
volumes:
- name: hugo-theme-lowtech_node_modules
host:
path: /tmp/drone/cache/weko/cremeaux/themes/hugo-theme-lowtech
- name: hugo-resources
host:
path: /tmp/drone/cache/weko/cremeaux/resources