added compile workflow

This commit is contained in:
neCo 2024-05-21 12:20:56 +02:00
parent 4914910a2d
commit 91eacb24af

53
.github/workflows/compile_mikupad.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: compile mikupad
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