apps.ad5001.eu/ci/drone.yml

110 lines
2.6 KiB
YAML
Raw Normal View History

2021-08-11 20:05:29 +00:00
---
2021-08-08 23:11:40 +00:00
kind: pipeline
name: default
clone:
git:
image: plugins/git
recursive: true
steps:
- name: Initilizing submodules
image: alpine/git
commands:
2021-08-11 20:05:29 +00:00
# Fetching submodules
2023-03-02 17:33:44 +00:00
- git submodule init
2021-08-11 20:05:29 +00:00
- git submodule update --init --recursive
2023-03-02 17:33:44 +00:00
# - name: Build dev.apps.ad5001.eu
# image: xdevbase/hugo-builder:latest
# commands:
# - hugo --config ci/dev.config.yml --minify
# when:
# event: [push, tag]
# branch: [master]
#
# - name: Remove old dev.apps.ad5001.eu
# image: appleboy/drone-ssh
# settings:
# host:
# from_secret: SSH_HOST
# username:
# from_secret: SSH_USERNAME
# password:
# from_secret: SSH_PASSWORD
# envs:
# - DEV_WWW_PATH
# script:
# - export DEV_WWW_PATH=$DEV_WWW_PATH
# - cd "$DEV_WWW_PATH"
# - rm -rf *
# when:
# event: [push, tag]
# branch: [master]
#
# - name: Deploy dev.apps.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: [master]
2021-08-08 23:11:40 +00:00
- name: Build apps.ad5001.eu
2023-04-15 20:01:35 +00:00
image: xdevbase/hugo-builder
2021-08-08 23:11:40 +00:00
commands:
2021-09-02 13:50:22 +00:00
- hugo --minify
2021-08-08 23:11:40 +00:00
when:
2021-08-11 20:05:29 +00:00
event: [push, tag]
2023-03-02 17:33:44 +00:00
branch: [master]
2021-08-11 20:05:29 +00:00
2021-08-08 23:45:27 +00:00
- name: Remove old apps.ad5001.eu
image: appleboy/drone-ssh
environment:
PROD_WWW_PATH:
from_secret: PROD_WWW_PATH
settings:
host:
from_secret: SSH_HOST
username:
from_secret: SSH_USERNAME
password:
from_secret: SSH_PASSWORD
2023-03-02 17:33:44 +00:00
port:
from_secret: SSH_PORT
2021-08-08 23:45:27 +00:00
envs:
2021-08-11 20:05:29 +00:00
- PROD_WWW_PATH
2021-08-08 23:45:27 +00:00
script:
2021-08-15 14:48:07 +00:00
- export PROD_WWW_PATH=$PROD_WWW_PATH
2021-08-11 20:05:29 +00:00
- cd "$PROD_WWW_PATH"
- rm -rf *
2021-08-08 23:45:27 +00:00
when:
2021-08-11 20:05:29 +00:00
event: [push, tag]
2023-03-02 17:33:44 +00:00
branch: [master]
2021-08-08 23:11:40 +00:00
- name: Deploy apps.ad5001.eu
image: appleboy/drone-scp
settings:
host:
from_secret: SSH_HOST
username:
from_secret: SSH_USERNAME
password:
from_secret: SSH_PASSWORD
2023-03-02 17:33:44 +00:00
port:
from_secret: SSH_PORT
2021-08-08 23:11:40 +00:00
target:
from_secret: PROD_WWW_PATH
source: public/*
when:
2021-08-11 20:05:29 +00:00
event: [push, tag]
2023-03-02 17:33:44 +00:00
branch: [master]