Build #9
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 | |
with: | |
token: ${{ secrets.PAT }} | |
- 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 | |
run: | | |
git config --global user.name 'Songbird bot' | |
git config --global user.email '[email protected]' | |
git add dist | |
git commit -m "\ | |
${{ steps.commit-title.outputs.out }}\ | |
\n\n\ | |
Build was created as a result of commit ${{ github.event.workflow_run.head_commit.id }}\n[skip actions]" | |
git push |