feat: CI/CD setup

This commit is contained in:
cellarspoon 2022-01-05 11:02:44 +01:00
parent 36d5d2c976
commit 24851a0d02
No known key found for this signature in database
GPG Key ID: 03789458B3D0C410
5 changed files with 47 additions and 12 deletions

27
.drone.yml Normal file
View File

@ -0,0 +1,27 @@
---
kind: pipeline
name: continuous deployment
steps:
- name: build image
image: plugins/docker
settings:
username:
from_secret: docker_reg_username
password:
from_secret: docker_reg_passwd
repo: decentral1se/beta.lumbung.space
tags: latest
- name: deploy stack
image: decentral1se/stack-ssh-deploy:latest
settings:
stack: beta_lumbung_space
host: lumbung.space
deploy_key:
from_secret: drone_ssh_lumbung.space
trigger:
branch:
- main
event:
exclude:
- pull_request

View File

@ -1,11 +0,0 @@
FROM klakegg/hugo:alpine
RUN apk add --no-cache curl git
EXPOSE 1313
COPY . /src/
ENTRYPOINT ["/bin/bash"]
CMD ["-c", "hugo server --appendPort='false' --bind 0.0.0.0 --baseUrl='https://beta.lumbung.space' --port='1313' -F"]

7
Dockerfile.hugo Normal file
View File

@ -0,0 +1,7 @@
FROM klakegg/hugo:alpine
RUN apk add --no-cache curl git
EXPOSE 1313
COPY . /src/

View File

@ -14,6 +14,14 @@ services:
start_period: 15s
volumes:
- content:/src/content
command: |
server
--appendPort='false'
--bind 0.0.0.0
--baseUrl='https://beta.lumbung.space'
--port='1313'
--buildFuture
--watch
deploy:
update_config:
failure_action: rollback

View File

@ -9,4 +9,8 @@ gen:
lumbunglib-cal && \
OUTPUT_DIR=content/video lumbunglib-vid
.PHONY: serve
push-hugo:
@docker build -t decentral1se/beta.lumbung.space -f Dockerfile.hugo . && \
docker push decentral1se/beta.lumbung.space
.PHONY: serve gen push-hugo