From 0d19308054d86db6bcdad17157bc17f4d0453b3d Mon Sep 17 00:00:00 2001 From: scb261 <65343233+scb261@users.noreply.github.com> Date: Tue, 11 Mar 2025 10:39:02 +0200 Subject: [PATCH] Rework website update workflow (#1851) --- .github/workflows/build_push.yml | 14 +------------- .github/workflows/update_website.yml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/update_website.yml diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index fa1dd2f66..047064f78 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -120,16 +120,4 @@ jobs: mihon-x86_64-${{ env.VERSION_TAG }}.apk draft: true prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update website - if: startsWith(github.ref, 'refs/tags/') && github.repository == 'mihonapp/mihon' - run: | - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.MIHON_BOT_TOKEN }}" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/mihonapp/website/dispatches \ - -d '{"event_type":"app_release"}' + token: ${{ secrets.MIHON_BOT_TOKEN }} diff --git a/.github/workflows/update_website.yml b/.github/workflows/update_website.yml new file mode 100644 index 000000000..452d2e438 --- /dev/null +++ b/.github/workflows/update_website.yml @@ -0,0 +1,23 @@ +name: Update website + +on: + release: + types: + - published + - deleted + - edited + +jobs: + update_website: + runs-on: 'ubuntu-24.04' + + steps: + - name: Update website + run: | + curl --fail-with-body -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.MIHON_BOT_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/mihonapp/website/dispatches \ + -d '{"event_type":"app_release"}'