-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 2.18 KB
/
ci.yml
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
# /* Some CSS: https://github.com/MajliTech/some-css */
# /* Copyright (C) 2024 MajliTech */
# /* */
# /* This program is free software: you can redistribute it and/or modify */
# /* it under the terms of the GNU General Public License as published by */
# /* the Free Software Foundation, either version 3 of the License, or */
# /* (at your option) any later version. */
# /* This program is distributed in the hope that it will be useful, */
# /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
# /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
# /* GNU General Public License for more details. */
# /* You should have received a copy of the GNU General Public License */
# /* along with this program. If not, see <https://www.gnu.org/licenses/>.*/
name: CI
on:
push:
branches:
- main
pull_request:
types: [opened, edited]
workflow_dispatch:
jobs:
verify:
name: Verify CSS
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
- run: npm -g i csstree-validator
- name: Verify CSS
run: bash ./verify.sh
minify:
runs-on: ubuntu-22.04
name: Minify CSS
needs: [verify]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
- run: npm -g i minify
- name: Minify CSS
run: bash ./minify.sh
- name: Set Git User Info
run: bash -c 'git config --global user.name "some-css bot"; git config --global user.email "[email protected]"; git config --global credential.helper store'
- name: Authenticate to git
run: echo https://majlitech:${{ secrets.GITHUB_TOKEN }}@github.com > ~/.git-credentials
- name: Push to repo
run: bash -c "git add min-css; git commit -m 'Minify CSS (commit $(git rev-parse HEAD | head -c 7))'; git push"
# <waiting for response from w3c (https://github.com/w3c/css-validator/issues/413)>