Skip to content

Commit

Permalink
ci: don’t commit css if nothing has changed
Browse files Browse the repository at this point in the history
  • Loading branch information
nimbleghost committed May 7, 2023
1 parent e9ce7f7 commit ac584c6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/tailwindcss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
working-directory: app/static
run: npm install
run: npm ci
- name: Build CSS
working-directory: app/static
run: npx tailwindcss -o css/main.css --minify
- name: Commit and push changes
run: |
git config --global user.email "github-actions@github.com"
git config --global user.name "Github Actions"
git add app/static/
git commit --allow-empty -m "Minifed CSS"
git push
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
if output="$(git status --porcelain)" && [ -z "$output" ]; then
echo "Nothing to commit."
else
git add app/static/
git commit -m "Minifed CSS"
git push
fi

0 comments on commit ac584c6

Please sign in to comment.