xmc/.gitlab-ci.yml

41 lines
974 B
YAML
Raw Normal View History

2022-10-19 02:59:48 +00:00
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
2022-10-19 02:59:48 +00:00
- npm i -g pnpm
2022-10-19 03:23:37 +00:00
- npm i -g prettier
2022-10-19 02:59:48 +00:00
- 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
2022-10-19 03:23:37 +00:00
- prettier --write modular/**/*.css
- prettier --write modular/*.css
2022-10-19 02:59:48 +00:00
- 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
2022-10-19 16:40:37 +00:00
- sed -i "s/@version 0.0.0/@version 0+${CI_COMMIT_SHA:0:8}/" public/xmc.user.css
2022-10-19 03:00:45 +00:00
artifacts:
2022-10-19 02:59:48 +00:00
paths:
- public
only:
2022-10-19 02:59:48 +00:00
changes:
- modular/*