From 573c2f86b6309e446e04aefd642deffb68e9d560 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 4 Aug 2022 09:56:39 -0400 Subject: [PATCH] Use builds.sr.ht for CI, switch to hardcoded baseURL --- .build.yml | 17 +++++++++++++++++ .gitlab-ci.yml | 39 --------------------------------------- Caddyfile | 26 -------------------------- Dockerfile | 12 ------------ config.toml | 1 + 5 files changed, 18 insertions(+), 77 deletions(-) create mode 100644 .build.yml delete mode 100644 .gitlab-ci.yml delete mode 100644 Caddyfile delete mode 100644 Dockerfile diff --git a/.build.yml b/.build.yml new file mode 100644 index 0000000..930b411 --- /dev/null +++ b/.build.yml @@ -0,0 +1,17 @@ +image: alpine/edge +packages: + - rsync + - git + - hugo +sources: + - https://git.sr.ht/~redstrate/xiv.zone +secrets: + - b748582a-5d31-4fe8-94d6-4a63035e97aa +tasks: + - build: | + cd xiv.zone + hugo + - deploy: | + cd xiv.zone + echo "StrictHostKeyChecking=no" >> ~/.ssh/config + rsync -Wvr public/ deploy@ryne.moe:/var/ryne/sync/xiv.zone diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index a0c6464..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -build: - stage: build - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [""] - script: - - if [ "$CI_COMMIT_REF_NAME" == "develop" ]; then DOMAIN="https://staging.xiv.zone/"; else DOMAIN="https://xiv.zone/"; fi - - mkdir -p /kaniko/.docker - - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json - - >- - /kaniko/executor - --context "${CI_PROJECT_DIR}" - --dockerfile "${CI_PROJECT_DIR}/Dockerfile" - --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}" - --build-arg DOMAIN=$DOMAIN - -deploy-staging: - stage: deploy - image: - name: curlimages/curl:latest - script: - - 'curl -H "Authorization: Bearer ${WATCHTOWER_TOKEN}" https://xiv.zone/v1/update' - environment: - name: staging - url: https://staging.xiv.zone - only: - - develop - -deploy-production: - stage: deploy - image: - name: curlimages/curl:latest - script: - - 'curl -H "Authorization: Bearer ${WATCHTOWER_TOKEN}" https://xiv.zone/v1/update' - environment: - name: production - url: https://xiv.zone - only: - - main diff --git a/Caddyfile b/Caddyfile deleted file mode 100644 index 3959583..0000000 --- a/Caddyfile +++ /dev/null @@ -1,26 +0,0 @@ -{ - admin off # we dont use this so lol - debug -} - - -:9455 { - header { - -Server - - Cache-Control "max-age=604800, immutable" - } - - handle_path /astra-distrib/* { - root * /astra-distrib - } - - handle_path /distrib/* { - root * /astra-distrib - } - - encode gzip - - file_server -} - diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 683a754..0000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM klakegg/hugo:alpine AS build - -COPY . /site -WORKDIR /site -ARG DOMAIN - -RUN hugo --baseURL ${DOMAIN} - -FROM caddy - -COPY Caddyfile /etc/caddy/Caddyfile -COPY --from=build /site/public /srv diff --git a/config.toml b/config.toml index eaa9ff3..c53f47e 100644 --- a/config.toml +++ b/config.toml @@ -4,6 +4,7 @@ theme = "mytheme" summaryLength = 30 disableHugoGeneratorInject = true enableEmoji = true +baseURL = "http://xiv.zone/" [params] mainSections = ["astra"]