diff --git a/.hugo_build.lock b/.hugo_build.lock deleted file mode 100644 index e69de29..0000000 diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..33bc5e6 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,26 @@ +pipeline: + build: + image: klakegg/hugo:ext-alpine-ci + commands: + - hugo + - tar czvf site.tar.gz public/ + + upload: + image: plugins/s3 + settings: + endpoint: https://api.minio.arsenm.dev + path_style: true + bucket: site + access_key: AkdgUdmzEJBoiYa2 + secret_key: + from_secret: minio_secret_key + source: site.tar.gz + target: / + + deploy: + image: loq9/drone-nomad + settings: + addr: http://192.168.100.62:4646 + template: template.nomad + environment: + - PLUGIN_WATCH_DEPLOYMENT=true \ No newline at end of file diff --git a/template.nomad b/template.nomad new file mode 100644 index 0000000..b10e278 --- /dev/null +++ b/template.nomad @@ -0,0 +1,47 @@ +job "site" { + region = "global" + datacenters = ["dc1"] + type = "service" + + group "site" { + count = 2 + + network { + port "nginx" { + to = 80 + } + } + + task "nginx" { + driver = "docker" + + config { + image = "nginx:latest" + ports = ["nginx"] + volumes = ["local/site/public:/usr/share/nginx/html:ro"] + } + + artifact { + source = "https://api.minio.arsenm.dev/site/site.tar.gz" + destination = "local/site" + } + + service { + name = "site" + port = "nginx" + + tags = [ + "traefik.enable=true", + + "traefik.http.middlewares.site-redir.redirectRegex.regex=^https://arsenm\\.dev", + "traefik.http.middlewares.site-redir.redirectRegex.replacement=https://www.arsenm.dev", + "traefik.http.middlewares.site-redir.redirectRegex.permanent=true", + + "traefik.http.routers.site.rule=Host(`arsenm.dev`) || Host(`www.arsenm.dev`)", + "traefik.http.routers.site.middlewares=site-redir", + "traefik.http.routers.site.tls.certResolver=letsencrypt", + ] + } + } + } +}