Use builds.sr.ht for CI, switch to hardcoded baseURL
This commit is contained in:
parent
91809eb0fd
commit
573c2f86b6
5 changed files with 18 additions and 77 deletions
17
.build.yml
Normal file
17
.build.yml
Normal file
|
@ -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
|
|
@ -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
|
26
Caddyfile
26
Caddyfile
|
@ -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
|
||||
}
|
||||
|
12
Dockerfile
12
Dockerfile
|
@ -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
|
|
@ -4,6 +4,7 @@ theme = "mytheme"
|
|||
summaryLength = 30
|
||||
disableHugoGeneratorInject = true
|
||||
enableEmoji = true
|
||||
baseURL = "http://xiv.zone/"
|
||||
|
||||
[params]
|
||||
mainSections = ["astra"]
|
||||
|
|
Loading…
Add table
Reference in a new issue