-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.06 KB
/
build-main-action.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
43
44
45
46
47
name: build main action
concurrency:
group: build-main-action
on:
push:
branches:
- main
- image-operation
paths:
- js-action/src/**/*
- js-action/package*.json
- js-action/*.js
permissions:
contents: write
env:
AUTHOR_EMAIL: [email protected]
AUTHOR_NAME: 'Github Actions'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
with:
node-version: 20
- name: node modules
working-directory: ./js-action
run: npm ci
- name: build
working-directory: ./js-action
run: npm run build
- name: commit builded action
run: |
if git status | grep 'js-action/dist/' -q;
then
git config --global user.email "${AUTHOR_EMAIL}"
git config --global user.name "${AUTHOR_NAME}"
git add ./js-action/dist
git commit -m "builded action"
git push origin ${{ github.ref }}:${{ github.ref }}
fi