Skip to content

Commit 03188f3

Browse files
authored
Create GitHub Action to BuildCSS.yml
Github action automatically builds the CSS files in the `css/` directory from the `scss/` directory in merge and push requests using npm
1 parent 8be4490 commit 03188f3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/BuildCSS.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build CSS
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
permissions:
16+
contents: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v2
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: '20'
26+
27+
- name: Install dependencies
28+
run: npm install
29+
30+
- name: Build CSS
31+
run: npm run build
32+
33+
- name: Commit and push changes
34+
run: |
35+
git config --global user.name 'github-actions[bot]'
36+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
37+
git add .
38+
git commit -m 'Build CSS'
39+
git push
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)