feat: v3.4.0 (#20) #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
with: | |
ref: main | |
- uses: actions/setup-node@v3 | |
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@v3 | |
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@v3 | |
with: | |
ref: dist | |
- uses: actions/download-artifact@v3 | |
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 |