Skip to content

Commit

Permalink
Make add_mod_port workflow wait for hugo build
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Jan 12, 2025
1 parent 2ee39f6 commit a72479b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/add_mod_port.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,21 @@ jobs:
git commit -m "[Wurst-Bot] Port $MOD $MOD_VERSION to Minecraft $MC_VERSION ($MODLOADER)"
git push
# For some reason the commit above doesn't automatically trigger the hugo
# workflow, so we need to explicitly start it here.
- name: Trigger hugo workflow
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run hugo.yml
id: hugo_dispatch
uses: codex-/return-dispatch@v2
with:
token: ${{ github.token }}
owner: Wurst-Imperium
repo: wimods.net
ref: master
workflow: hugo.yml

- name: Wait for website update to finish (run ${{ steps.hugo_dispatch.outputs.run_id }})
uses: codex-/await-remote-run@v1
with:
token: ${{ github.token }}
owner: Wurst-Imperium
repo: wimods.net
run_id: ${{ steps.hugo_dispatch.outputs.run_id }}
run_timeout_seconds: 300 # 5 minutes
6 changes: 6 additions & 0 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
# Update the copyright year on Jan 1st
- cron: "0 0 1 1 *"
workflow_dispatch:
inputs:
distinct_id:
description: "Automatically set by the return-dispatch action (leave blank if running manually)"
required: false

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -25,6 +29,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Echo distinct ID ${{ github.event.inputs.distinct_id }}
run: echo ${{ github.event.inputs.distinct_id }}
- name: Checkout
uses: actions/checkout@v4
- name: Install Hugo CLI
Expand Down

0 comments on commit a72479b

Please sign in to comment.