From 03188f30c200412f4714d5997793975c8a17e837 Mon Sep 17 00:00:00 2001 From: JWB Date: Sun, 22 Dec 2024 21:02:34 -0500 Subject: [PATCH] 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 --- .github/workflows/BuildCSS.yml | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/BuildCSS.yml diff --git a/.github/workflows/BuildCSS.yml b/.github/workflows/BuildCSS.yml new file mode 100644 index 00000000..f9500e27 --- /dev/null +++ b/.github/workflows/BuildCSS.yml @@ -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 }}