xmc/.gitlab-ci.yml

37 lines
874 B
YAML

image: node:16-alpine3.14
cache:
key: "${CI_COMMIT_BRANCH}_${CI_JOB_NAME}_new"
paths:
- bin/node_modules/
splitter:
stage: deploy
before_script:
- apk add --no-cache git
- npm i -g pnpm
- pnpm i -r
- git config --global user.name "CI"
- git config --global user.email "ci@c7.pm"
script:
- node bin/splitter.js xmc.user.css modular
- git add modular
- git commit -m "Make Modular"
- git push "https://${GITLAB_USER_LOGIN}:${CI_GIT_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" "HEAD:${CI_DEFAULT_BRANCH}"
only:
changes:
- xmc.user.css
pages:
stage: deploy
script:
- mkdir public
- cp -r modular public
- cp xmc.user.css public
- sed -i "s/@version 0.0.0/@version 0+${CI_COMMIT_HASH:0:8}/" public/xmc.user.css
artifacts:
paths:
- public
only:
changes:
- modular/*