-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.51 KB
/
build-assets.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build assets
on:
workflow_call:
inputs:
node-version:
required: false
type: string
default: '20.x'
file-pattern:
required: false
type: string
default: 'dist/**/*'
build-cmd:
required: false
type: string
default: 'npm run build'
needs-auth:
required: false
type: boolean
default: true
working-directory:
required: false
type: string
default: './'
secrets:
SSH_PRIVATE_KEY:
description: Authentication for privately hosted packages and repositories as a JSON formatted object.
required: false
jobs:
build-assets:
name: Build assets & commit/push changes
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- uses: webfactory/[email protected]
if: ${{ inputs.needs-auth }}
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: bahmutov/npm-install@v1
with:
working-directory: ${{ inputs.working-directory }}
- name: Build assets
run: ${{ inputs.build-cmd }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: 🤖 Build assets"
# file_pattern: ${{ inputs.file-pattern }}