Update node.js.yml #3
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- name: Copy mikupad.html to project directory | |
run: cp -f mikupad.html project | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./project | |
- name: Build the project | |
run: npm run build | |
working-directory: ./project | |
- name: Copy built mikupad.html to root directory | |
run: cp -f ./project/dist/mikupad.html ./mikupad_compiled.html | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add -f mikupad_compiled.html | |
git commit -m "Update mikupad_compiled.html" | |
git push origin main | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mikupad_compiled | |
path: mikupad_compiled.html |