-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (50 loc) · 1.51 KB
/
build.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
name: Build
on:
workflow_run:
workflows: Tests
branches: master
types: completed
jobs:
check-changes:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
songs_have_changed: ${{steps.songs-changed.outputs.out}}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Check if songs have changed
id: songs-changed
run: yarn --silent github songChanges >> "$GITHUB_OUTPUT"
build:
needs: check-changes
if: ${{ needs.check-changes.outputs.songs_have_changed == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Get commit message
id: commit-title
run: yarn --silent github buildCommitTitle >> "$GITHUB_OUTPUT"
- name: Commit build
uses: EndBug/add-and-commit@v9
with:
add: 'dist'
committer_name: Songbird Bot
message: >
${{ steps.commit-title.outputs.out }}
Build was created as a result of commit ${{ github.event.workflow_run.head_commit.id }}