-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
24 lines (23 loc) · 1002 Bytes
/
.gitlab-ci.yml
File metadata and controls
24 lines (23 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
variables:
FILES_TO_COMPRESS: "htm html txt text js css md ico svg"
APP_FOLDER: "app"
pages:
image: alpine:latest
before_script:
- apk update && apk add gzip brotli
script:
- mkdir -p .public .public/widget/ .public/css/themes .public/js/plugins .public/_i18n/
- cp $APP_FOLDER/*.svg $APP_FOLDER/index.html $APP_FOLDER/script.min.js $APP_FOLDER/script.min.js.map widget/widget.min.js robots.txt .public/
- cp $APP_FOLDER/_i18n/*.md .public/_i18n/
- cp $APP_FOLDER/css/styles.min.css .public/css/
- cp $APP_FOLDER/css/themes/* .public/css/themes/
- cp widget/message.svg .public/widget/
- cp -r $APP_FOLDER/js/plugins/* .public/js/plugins/
- mv .public public
- for ext in $FILES_TO_COMPRESS; do find public -type f -name "*.$ext" -exec gzip -f -k {} \;; done
- for ext in $FILES_TO_COMPRESS; do find public -type f -name "*.$ext" -exec brotli -f -k {} \;; done
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "main"