Building Artifacts #1
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
name: auto-npm-build | |
run-name: Building Artifacts | |
on: | |
push: | |
# branches: [ master ] | |
paths: | |
- 'src/**' | |
- package.json | |
- webpack.config.js | |
jobs: | |
npm-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: npm install | |
run: npm ci | |
- name: building the app | |
run: npm run build | |
- name: check for changes | |
id: git-check | |
run: echo ::set-output name=modified::$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi) | |
- name: commit changed files | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git config --local user.name "GitHub Actions" | |
git add . | |
git commit -m "Build Artifacts" | |
git push origin HEAD:master |