This repository was archived by the owner on May 4, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
70 lines (67 loc) · 2.18 KB
/
compile.yml
File metadata and controls
70 lines (67 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Compile & Push
on:
push:
branches:
- main
workflow_dispatch:
jobs:
compile:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install Less
run: npm install -g less
- name: Install the csso
run: npm install -g csso-cli
- name: Compile Less
run: |
lessc ./src/DNOME.less ./dist/DNOME.css
for accent in blue green orange pink purple red slate teal yellow; do
echo "@accent_name: \"$accent\";" > ./src/override_accent.less
lessc ./src/DNOME.less ./dist/DNOME-$accent.css
done
rm -f ./src/override_accent.less
- name: Optimize CSS
run: |
csso ./dist/DNOME.css -o ./dist/DNOME.css --comments none --stat
for accent in blue green orange pink purple red slate teal yellow; do
csso ./dist/DNOME-$accent.css -o ./dist/DNOME-$accent.css --comments none --stat
done
# csso downcases some pseudo content
# escaped characters
sed -i 's/\\a/\\A/g' ./dist/*.css
- uses: actions/upload-artifact@v4
with:
path: ./dist/
push:
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
needs: [ compile ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dist
- uses: actions/download-artifact@v4
with:
path: ./dnome/
- name: Commit files
run: |
mv ./dnome/**/*.css ./
rm -rf ./dnome/
git add -f './*.css'
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -am "chore: compile latest changes"
- name: Push changes
uses: ad-m/github-push-action@552c074ed701137ebd2bf098e70c394ca293e87f
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dist