From e49ac4f7496d51fe7e5b65ee660a3293e3f4b404 Mon Sep 17 00:00:00 2001 From: Jared Van Valkengoed <86180097+MarketingPip@users.noreply.github.com> Date: Mon, 7 Oct 2024 00:30:16 -0400 Subject: [PATCH] =?UTF-8?q?Added=20build.yaml=20=F0=9F=93=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yaml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..052d402 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,39 @@ +name: Build and Commit Changes + +on: + workflow_dispatch: + +jobs: + build-and-commit: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js environment + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Build project using Webpack/Rollup + run: | + npm i + npm run build + + - name: Commit and push changes + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + git add -A + git reset -- node_modules # Unstage the node_modules changes + if ! git diff --cached --quiet; then + git diff --cached --name-only | while read -r file; do + commit_message="Updated $file :inbox_tray:" + git commit -m "$commit_message" -- "$file" + done + + git push + else + echo "No changes to commit." + fi