ad5001.eu/ci/drone.yml
Ad5001 e7e6ec184c
All checks were successful
continuous-integration/drone/push Build is passing
Trying to fix submodule fetch (patch will be removed in the future when omegamma goes public).
2021-08-09 00:14:19 +02:00

75 lines
1.9 KiB
YAML

kind: pipeline
name: default
clone:
git:
image: plugins/git
recursive: true
steps:
- name: Initilizing submodules
image: alpine/git
environment:
GIT_ASKPASS: "/bin/git-askpass-from-env"
commands:
# Installing little script to get git password from environment.
- wget https://download.ad5001.eu/other/git-askpass-from-env.sh
- mv git-askpass-from-env.sh /bin/git-askpass-from-env
- chmod +x /bin/git-askpass-from-env
# Changing submodule URL to https://<USERNAME>@git.ad5001.eu/Ad5001/omegamma.git
- git submodule init
- git config submodule.sub/omegamma.url https://$DRONE_GIT_USERNAME@git.ad5001.eu/Ad5001/omegamma.git
# Fetching submodules
- git submodule update --init --recursive
- name: Build dev.ad5001.eu
image: xdevbase/hugo-builder:latest
commands:
- ls themes/omegamma
- ls themes/omegamma/layouts/shortcodes
- hugo -b https://dev.ad5001.eu
when:
event: [ push, tag ]
branch: [ main ]
- name: Deploy dev.ad5001.eu
image: appleboy/drone-scp
settings:
host:
from_secret: SSH_HOST
username:
from_secret: SSH_USERNAME
password:
from_secret: SSH_PASSWORD
target:
from_secret: DEV_WWW_PATH
source: public/*
when:
event: [ push, tag ]
branch: [ main ]
- name: Build ad5001.eu
image: plugins/hugo
settings:
hugo_version: 0.80
validate: true
when:
event: [ push, tag ]
branch: [ prod ]
- name: Deploy ad5001.eu
image: appleboy/drone-scp
settings:
host:
from_secret: SSH_HOST
username:
from_secret: SSH_USERNAME
password:
from_secret: SSH_PASSWORD
target:
from_secret: PROD_WWW_PATH
source: public/*
when:
event: [ push, tag ]
branch: [ prod ]