Skip to content

Commit

Permalink
Create GitHub Action to BuildCSS.yml
Browse files Browse the repository at this point in the history
Github action automatically builds the CSS files in the `css/` directory from the `scss/` directory in merge and push requests using npm
  • Loading branch information
Yohn authored Dec 23, 2024
1 parent 8be4490 commit 03188f3
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/BuildCSS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build CSS

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Build CSS
run: npm run build

- name: Commit and push changes
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m 'Build CSS'
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 03188f3

Please sign in to comment.