-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added build automation * Updated to build on pull requests
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build and Commit | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- build-and-commit # For testing purposes | ||
pull_request: | ||
branches: | ||
- master | ||
- build-and-commit # For testing purposes | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '21' # Change this to the version of Node.js you are using | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build project | ||
run: npm run build | ||
- name: Check for changes | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add . | ||
if git diff-index --quiet HEAD; then | ||
echo "No changes to commit" | ||
else | ||
git commit -m "Build: Commit changes after build" | ||
git push | ||
fi | ||