Build #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
permissions: | |
contents: write | |
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 commitTitle >> "$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 }} |