Add initial files

This commit is contained in:
Joshua Goins 2022-04-08 18:12:46 -04:00
commit 97f03aa551
3 changed files with 73 additions and 0 deletions

39
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,39 @@
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

22
Caddyfile Normal file
View file

@ -0,0 +1,22 @@
{
admin off # we dont use this so lol
}
:9455 {
header {
-Server
Cache-Control "max-age=604800, immutable"
}
handle /astra-distrib {
root * /var/astra-distrib
file_server
}
encode gzip
file_server
}

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
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