File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : 🏗️ Compile latest changes
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ build :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout code
13
+ uses : actions/checkout@v2
14
+ with :
15
+ fetch-depth : 0
16
+
17
+ - name : Setup Node.js
18
+ uses : actions/setup-node@v2
19
+ with :
20
+ node-version : ' 20'
21
+
22
+ - name : Install dependencies
23
+ run : npm install
24
+
25
+ - name : Build project
26
+ run : npm run build
27
+
28
+ - name : Commit changes
29
+ run : |
30
+ git config --local user.email "[email protected] "
31
+ git config --local user.name "GitHub Action"
32
+ git add dist/
33
+ git diff --quiet && git diff --staged --quiet || git commit -m "compile latest changes"
34
+ if [ $? -eq 0 ]; then echo "CHANGES=true" >> $GITHUB_ENV; fi
35
+
36
+ - name : Push changes
37
+ if : env.CHANGES == 'true'
38
+ uses : ad-m/github-push-action@master
39
+ with :
40
+ github_token : ${{ secrets.GITHUB_TOKEN }}
41
+ branch : ${{ github.ref }}
You can’t perform that action at this time.
0 commit comments