xmc/.gitlab-ci.yml

42 lines
1,015 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
- npm i -g prettier
- pnpm i -r
- git config --global user.name "CI"
- git config --global user.email "ci@c7.pm"
script:
- rm -rf modular
- mkdir modular
- node bin/splitter.js xmc.user.css modular
- prettier --write modular/**/*.css
- prettier --write modular/*.css
- 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_SHA:0:8}/" public/xmc.user.css
artifacts:
paths:
- public
only:
changes:
- modular/*