Hugo-portfolio/.drone.yml

59 lines
1.4 KiB
YAML

kind: pipeline
type: docker
name: build
steps:
- name: submodules
image: alpine/git
enrironment:
GITHUB_TOKEN:
from_secret: github_token
commands:
- git submodule update --init --recursive
- name: content-build
image: plugins/hugo
settings:
hugo_version: 0.105.0
extended: true
- name: image-build
image: docker:dind
environment:
DOCKER_USER:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USER --password-stdin registry.coincoingit.fr
- DOCKER_BUILDKIT=1 docker build --tag registry.coincoingit.fr/cyberduck-blog:latest --file deployment/Dockerfile .
- docker push registry.coincoingit.fr/cyberduck-blog:latest
volumes:
- name: docker-sock
path: /var/run/docker.sock
- name: deploy
image: docker:dind
environment:
DOCKER_USER:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password
commands:
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USER --password-stdin registry.coincoingit.fr
- docker stack deploy --with-registry-auth -c deployment/stack.yml cyberduck_blog
volumes:
- name: docker-sock
path: /var/run/docker.sock
trigger:
event:
- push
branch:
- master
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock