Skip to content

Commit 96bab24

Browse files
author
David Heinemeier Hansson
authored
Merge pull request #3 from MikeRogers0/feature/automate-updating-tailwind-css
Automate the updating of Tailwind CSS via GitHub Action
2 parents 3901b59 + 24d12b6 commit 96bab24

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/update-tailwind.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update Tailwind
2+
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
steps:
13+
- uses: actions/checkout@master
14+
- name: Update app/assets/stylesheets/tailwind.css
15+
run: |
16+
npx tailwindcss-cli@latest build -o app/assets/stylesheets/tailwind.css
17+
- name: Commit files
18+
run: |
19+
TAILWIND_CSS_VERSION=`npm view tailwindcss@latest version`
20+
git config --local user.email "github-actions@example.com"
21+
git config --local user.name "GitHub Actions"
22+
git add app/assets/stylesheets/tailwind.css
23+
git commit -am "[nodoc] Updating Tailwind CSS to $TAILWIND_CSS_VERSION" || echo "No changes to commit"
24+
- name: Push changes
25+
uses: ad-m/github-push-action@master
26+
with:
27+
github_token: ${{ secrets.GITHUB_TOKEN }}
28+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)