+ New builder templates

This commit is contained in:
shockrah 2022-03-20 15:54:56 -07:00
parent 23220caf7a
commit 1a42031aac
2 changed files with 25 additions and 21 deletions

View File

@ -1,40 +1,31 @@
image: shockrah/website:latest image: shockrah/website:latest
stages: stages:
- build - build
- deploy - deploy
include:
- local: 'ci/builders.yml'
build-site: build-neocities: &builder
only:
refs:
- master
stage: build
script: script:
- hugo version - hugo --config configs/neocities.toml
- hugo
build-pages: &builder
script:
- hugo --config configs/pages.toml
artifacts:
paths:
- public/
pages: pages:
stage: deploy stage: deploy
needs: needs:
- build-site - build-pages
dependencies: dependencies:
- build-site - build-site
# Dummy script to keep the job valid
script: script:
- > - echo Dummy echo for pages job
if [ -d public/ ]; then
echo 'Public directory found'
else
echo 'Nothing found'
fi
artifacts: artifacts:
paths: paths:
- public/ - public/
@ -47,6 +38,6 @@ neocities:
- build-site - build-site
when: manual when: manual
dependencies: dependencies:
- build-site - build-neocities
script: script:
- bash scripts/neocities.sh - bash scripts/neocities.sh

13
ci/builders.yml Normal file
View File

@ -0,0 +1,13 @@
# This defines a script which all builders can basically inherit from
.builder:
stage: build
image: shockrah/website:latest
only:
refs:
- master
script:
- hugo
artifacts:
paths:
- public/