CD: Deploy to S3

This commit is contained in:
nemunaire 2023-04-15 17:11:27 +02:00
parent 8d72ea6789
commit 8cb3e1e744

View File

@ -11,29 +11,52 @@ steps:
- git submodule init - git submodule init
- git submodule update --recursive --remote - git submodule update --recursive --remote
- name: build - name: build production
image: plugins/hugo image: plugins/hugo
settings: settings:
hugo_version: 0.85.0 hugo_version: 0.91.2
validate: true validate: true
environment:
- name: deploy HUGO_ENV: "production"
image: appleboy/drone-scp
settings:
tar_tmp_path: /tmp/
host: www.nemunai.re
target: /var/www/nemunai.re/htdocs/
source: public/*
strip_components: 1
username:
from_secret: ssh_username
key:
from_secret: deploy_key
port:
from_secret: ssh_port
when: when:
branch: branch:
- master - master
event:
- name: build drafts
image: plugins/hugo
settings:
hugo_version: 0.91.2
validate: true
buildDrafts: true
buildExpired: true
buildFuture: true
environment:
HUGO_BASEURL: https://nemunai.re/${DRONE_BRANCH//\//-}/
when:
branch:
exclude: exclude:
- pull_request - master
- name: publish on s3
image: plugins/s3
settings:
endpoint: https://storage.nemunai.re
path_style: true
bucket: nemunai.re-blog
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: public/**/*
strip_prefix: public/
target: /${DRONE_BRANCH//\//-}
trigger:
branch:
exclude:
- renovate/*
event:
- cron
- push
- tag
- custom