-
Notifications
You must be signed in to change notification settings - Fork 95
42 lines (33 loc) · 1.02 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build
on:
push:
branches:
- master
paths:
- src/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.18.0'
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Remove .gitignore
run: rm -f .gitignore
- name: Get package version
id: package_version
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Commit and push if there are changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]@users.noreply.github.com"
git add dist/*
git diff --staged --quiet || git commit -m "🔧 Automated build: v${{ steps.package_version.outputs.version }}"
git push