From 61202d361715ed05b872fce334edf6d802e195ff Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 26 Mar 2023 00:16:42 +1100 Subject: [PATCH] CI to build javascript/css --- .gitlab-ci.yml | 4 +++- .gitlab-docker-x86_64.yml | 2 +- .gitlab-test.yml | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 34d272e..1d561d0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,10 @@ stages: # This folder is cached between builds # http://docs.gitlab.com/ce/ci/yaml/README.html#cache cache: - key: ${CI_JOB_NAME_SLUG}-${CI_COMMIT_REF_SLUG} + key: ${CI_COMMIT_REF_SLUG} paths: + - public/ + - node_modules/ - vendor/ include: diff --git a/.gitlab-docker-x86_64.yml b/.gitlab-docker-x86_64.yml index c5bca19..84756a4 100644 --- a/.gitlab-docker-x86_64.yml +++ b/.gitlab-docker-x86_64.yml @@ -17,7 +17,7 @@ docker: script: - if [ -f init ]; then chmod 500 init; fi - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - - rm -rf vendor/ database/schema database/seeders database/factories/* + - rm -rf node_modules database/seeds database/schema database/factories/* - docker build -f docker/Dockerfile -t ${CI_REGISTRY_IMAGE}:${VERSION} . - docker push ${CI_REGISTRY_IMAGE}:${VERSION} tags: diff --git a/.gitlab-test.yml b/.gitlab-test.yml index 197572f..7eb831d 100644 --- a/.gitlab-test.yml +++ b/.gitlab-test.yml @@ -28,6 +28,10 @@ test: before_script: - mv .env.testing .env + # Install npm and dependancies + - npm i + - npm run prod + # Install Composer and project dependencies. - mkdir -p ${COMPOSER_HOME} - if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > ${COMPOSER_HOME}/auth.json; fi