From 9722532ec2771c6cdd5e096079b6cea39baf4517 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Mon, 27 Jun 2022 02:06:32 +0200 Subject: [PATCH] chore: setup Gitlab pages --- .gitlab-ci.yml | 28 ++++++++++++++++++++-------- package.json | 3 ++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fef13ef..0ddcf23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,24 @@ -# You can override the included template(s) by including variable overrides -# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings -# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings -# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings -# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings -# Note that environment variables can be set in several places -# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence +image: node:18 + stages: -- test + - test + - deploy + +workflow: + rules: + - if: $CI_COMMIT_BRANCH + +pages: + stage: deploy + script: + - npm install + - npm run build + artifacts: + paths: + - _site + rules: + - if: $CI_COMMIT_BRANCH == "main" + sast: stage: test include: diff --git a/package.json b/package.json index 5213487..0f67ee9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "author": "Jalil Arfaoui ", "license": "MIT", "scripts": { - "dev": "eleventy --serve" + "dev": "eleventy --serve", + "build": "eleventy" }, "devDependencies": { "@11ty/eleventy": "^1.0.1",