cremeaux/.drone.yml

198 lines
5.1 KiB
YAML

---
# drone encrypt weko/cremeaux $REGISTRY_PASSWORD
kind: secret
name: REGISTRY_PASSWORD
data: LBA/OxVYdvjpnkkt4xIf5qtGyr4ih3bPlp8M+ApLDuCDwzXsbzhjzNWoN46gynvrK4arcrDERtjTZmsK/m2WJyBhsQH4lPnIYHauZG/K
---
# drone encrypt weko/cremeaux $REGISTRY_USER
kind: secret
name: REGISTRY_USER
data: Pbz4Z6a319mG7QOUsPuAV79rlEkrMvNB4Ce+ePAGsdDKuQ==
---
# drone encrypt weko/cremeaux "{\"auths\":{\"https://registry.weko.io\":{\"auth\":\"$(echo -n "$REGISTRY_USER:$REGISTRY_PASSWORD" | base64)\",\"email\":\"$REGISTRY_USER\"}}}"
kind: secret
name: REGISTRY_CONFIG
data: bfQfncKvtcLiePl+YODLHN5LyQ5mB3eWj2dVqbyDd78gv1E+jzhb/4W/B3u1bMyMPlw1Q2/XIWBF5D9kVcTHjh/x2fo7LpYPmk5JZeXEP9qsRk+Td/JEmCm9Bbp+uUEigs2jZFAebAfGseP9rS7KyYEmEkO/JcXVjFZAWgmjvnuZBi8jApUJEorqo+e6lhclceljCSITIC6jA/bwggeqtVxoNVf2r8BBLIL3
---
# 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
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: push docker image on registry
image: plugins/docker
settings:
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASSWORD
repo: registry.weko.io/cremeaux
registry: registry.weko.io
tags:
- latest
- 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
image_pull_secrets:
- REGISTRY_CONFIG
volumes:
- name: hugo-theme-lowtech_node_modules
host:
path: /tmp/drone/cache/weko/cremeaux/themes/hugo-theme-lowtech
---
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
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: push docker image on registry
image: plugins/docker
settings:
username:
from_secret: REGISTRY_USER
password:
from_secret: REGISTRY_PASSWORD
repo: registry.weko.io/cremeaux
registry: registry.weko.io
tags:
- staging
- 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
image_pull_secrets:
- REGISTRY_CONFIG
volumes:
- name: hugo-theme-lowtech_node_modules
host:
path: /tmp/drone/cache/weko/cremeaux/themes/hugo-theme-lowtech