From cbf3005b4e6ca8878f01c99b9f8b48025c86788d Mon Sep 17 00:00:00 2001 From: Gleb Arestov Date: Thu, 15 Oct 2026 18:11:15 +0400 Subject: [PATCH] fix(ci): report website dispatch failures --- .github/workflows/deploy.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7ae84be..a4e90bf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,10 +3,26 @@ on: push: branches: - main +permissions: {} jobs: deploy: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - - name: Send event to logux.org + - name: Request a logux.org rebuild + env: + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} run: | - curl -XPOST -u "${{ secrets.DEPLOY_USER }}:${{ secrets.DEPLOY_TOKEN }}" -H "Accept: application/vnd.github.everest-preview+json" -H "Content-Type: application/json" https://api.github.com/repos/logux/logux.org/dispatches --data '{"event_type": "deploy"}' + if [ -z "$DEPLOY_USER" ] || [ -z "$DEPLOY_TOKEN" ]; then + echo '::error::Set DEPLOY_USER and DEPLOY_TOKEN with repository dispatch access to logux/logux.org.' + exit 1 + fi + curl --fail-with-body --silent --show-error \ + --connect-timeout 10 --max-time 60 \ + --request POST \ + --user "$DEPLOY_USER:$DEPLOY_TOKEN" \ + --header 'Accept: application/vnd.github+json' \ + --header 'Content-Type: application/json' \ + https://api.github.com/repos/logux/logux.org/dispatches \ + --data '{"event_type":"deploy"}'