2021-08-17 00:27:54 +00:00
|
|
|
image: shockrah/website:latest
|
2021-02-09 03:22:48 +00:00
|
|
|
|
2022-03-20 22:54:56 +00:00
|
|
|
|
2021-02-09 03:22:48 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- deploy
|
|
|
|
|
2022-03-20 22:54:56 +00:00
|
|
|
include:
|
|
|
|
- local: 'ci/builders.yml'
|
2021-08-17 00:11:10 +00:00
|
|
|
|
2022-05-22 04:53:11 +00:00
|
|
|
################## ################## ##################
|
|
|
|
# ============== # Build Stage Jobs # ============== #
|
|
|
|
################## ################## ##################
|
|
|
|
|
2022-03-20 23:16:12 +00:00
|
|
|
build-neocities:
|
2022-03-20 23:01:11 +00:00
|
|
|
stage: build
|
2022-03-20 23:16:12 +00:00
|
|
|
extends: .builder
|
2022-03-20 22:54:56 +00:00
|
|
|
script:
|
|
|
|
- hugo --config configs/neocities.toml
|
2021-02-09 03:43:48 +00:00
|
|
|
|
2022-03-20 23:16:12 +00:00
|
|
|
build-pages:
|
2022-03-20 23:01:11 +00:00
|
|
|
stage: build
|
2022-03-20 23:16:12 +00:00
|
|
|
extends: .builder
|
2020-10-26 07:51:40 +00:00
|
|
|
script:
|
2022-05-03 22:05:35 +00:00
|
|
|
# Build the base config first
|
2022-03-20 22:54:56 +00:00
|
|
|
- hugo --config configs/pages.toml
|
2022-05-03 22:05:35 +00:00
|
|
|
# Next we fix the path to the font
|
|
|
|
- sed -i 's/\/media/\/shockrah-city\/media/g' public/css/style.css
|
2021-02-09 03:22:48 +00:00
|
|
|
|
2022-05-22 04:53:11 +00:00
|
|
|
build-shockrah.xyz:
|
|
|
|
stage: build
|
|
|
|
extends: .builder
|
|
|
|
script:
|
|
|
|
# Main config is found in the root of this project dir
|
|
|
|
- hugo
|
2022-07-01 22:36:43 +00:00
|
|
|
artifacts:
|
2022-07-01 22:48:11 +00:00
|
|
|
paths:
|
2022-07-01 22:36:43 +00:00
|
|
|
- public/
|
2022-01-19 23:37:18 +00:00
|
|
|
|
2022-05-22 04:53:11 +00:00
|
|
|
################## ################## ##################
|
|
|
|
# ============== # Deploy Stage Jobs # ============== #
|
|
|
|
################## ################## ##################
|
2022-01-19 23:37:18 +00:00
|
|
|
|
2022-05-22 04:53:11 +00:00
|
|
|
# Deploys the gitlab Page
|
2022-03-20 21:20:28 +00:00
|
|
|
pages:
|
|
|
|
stage: deploy
|
|
|
|
needs:
|
2022-03-20 22:54:56 +00:00
|
|
|
- build-pages
|
2022-03-20 21:20:28 +00:00
|
|
|
dependencies:
|
2022-03-20 22:59:15 +00:00
|
|
|
- build-pages
|
2022-03-20 21:20:28 +00:00
|
|
|
script:
|
2022-03-20 22:54:56 +00:00
|
|
|
- echo Dummy echo for pages job
|
2022-03-20 21:20:28 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- public/
|
2021-02-09 03:22:48 +00:00
|
|
|
|
2022-05-22 04:53:11 +00:00
|
|
|
# Deploys to the main blog
|
|
|
|
deploy-shockrah.xyz:
|
|
|
|
stage: deploy
|
|
|
|
image: shockrah/ansible:latest
|
|
|
|
needs:
|
|
|
|
- build-shockrah.xyz
|
|
|
|
dependencies:
|
|
|
|
- build-shockrah.xyz
|
|
|
|
before_script:
|
|
|
|
- eval "$(ssh-agent -s)"
|
|
|
|
- echo "${CI_USER_KEY}" | tr -d '\r' | ssh-add -
|
|
|
|
- mkdir -p ~/.ssh/
|
|
|
|
- chmod 700 ~/.ssh/
|
|
|
|
- ssh-keyscan "$HOST" 2>&1 >> ~/.ssh/known_hosts
|
|
|
|
- chmod 644 ~/.ssh/known_hosts
|
|
|
|
script:
|
2022-07-01 21:57:51 +00:00
|
|
|
- ansible-playbook -i $INVENTORY scripts/deploy-blog.yml
|
2021-02-09 03:22:48 +00:00
|
|
|
|
|
|
|
|
2022-05-22 04:53:11 +00:00
|
|
|
# Deploy to neocities via their curl api
|
|
|
|
deploy-neocities:
|
2022-03-20 21:20:28 +00:00
|
|
|
stage: deploy
|
|
|
|
needs:
|
2022-03-20 22:59:15 +00:00
|
|
|
- build-neocities
|
2022-03-20 21:20:28 +00:00
|
|
|
when: manual
|
|
|
|
dependencies:
|
2022-03-20 22:54:56 +00:00
|
|
|
- build-neocities
|
2022-03-20 21:20:28 +00:00
|
|
|
script:
|
|
|
|
- bash scripts/neocities.sh
|