Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: don’t commit css if nothing has changed #125

Merged
merged 1 commit into from
May 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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