forked from Awayume/github-pr-tasklist-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (63 loc) · 1.68 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build
on:
workflow_dispatch:
inputs:
release:
description: 'Create a release build'
required: false
type: boolean
push:
branches-ignore:
- 'build'
paths:
- '.github/workflows/**'
- 'src/**'
- 'action.yaml'
- 'package-lock.json'
jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache node_modules
uses: actions/cache@v4
with:
path: 'node_modules'
key: node-${{ hashFiles('package-lock.json') }}
restore-keys: node-
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Create release build
if: ${{ inputs.release }}
run: |
npm install
npm run build
env:
NODE_ENV: production
- name: Create debug build
if: ${{ !inputs.release }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
git fetch origin build
git switch build
git merge ${GITHUB_REF#refs/heads/}
npm install
npm run build
- name: Push to GitHub
uses: EndBug/add-and-commit@v9
with:
add: '-f ./dist'
author_name: 'GitHub Actions'
author_email: '[email protected]'
message: |
:rocket: Build action
Co-authored-by: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>