From 1a42031aac552f2f533e0cf588fdb4582d11b84f Mon Sep 17 00:00:00 2001 From: shockrah Date: Sun, 20 Mar 2022 15:54:56 -0700 Subject: [PATCH] + New builder templates --- .gitlab-ci.yml | 33 ++++++++++++--------------------- ci/builders.yml | 13 +++++++++++++ 2 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 ci/builders.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 877c45c..409ad0d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,40 +1,31 @@ image: shockrah/website:latest + stages: - build - deploy +include: + - local: 'ci/builders.yml' -build-site: - only: - refs: - - master - - stage: build - +build-neocities: &builder script: - - hugo version - - hugo + - hugo --config configs/neocities.toml + +build-pages: &builder + script: + - hugo --config configs/pages.toml - artifacts: - paths: - - public/ pages: stage: deploy needs: - - build-site + - build-pages dependencies: - build-site - # Dummy script to keep the job valid script: - - > - if [ -d public/ ]; then - echo 'Public directory found' - else - echo 'Nothing found' - fi + - echo Dummy echo for pages job artifacts: paths: - public/ @@ -47,6 +38,6 @@ neocities: - build-site when: manual dependencies: - - build-site + - build-neocities script: - bash scripts/neocities.sh diff --git a/ci/builders.yml b/ci/builders.yml new file mode 100644 index 0000000..918f9be --- /dev/null +++ b/ci/builders.yml @@ -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/ +