diff --git a/.github/workflows/ota-pre.yml b/.github/workflows/ota-pre.yml new file mode 100644 index 00000000..fdb895b7 --- /dev/null +++ b/.github/workflows/ota-pre.yml @@ -0,0 +1,40 @@ +name: OTA Pre + +# Tells gpustack/gpustack-ota that runner.py.json changed on main, so +# https://ota.gpustack.ai/pre follows main within minutes of the merge. The path +# is the one gpustack-ota's sources.yaml reads from here. Run it by hand to check +# the announcement reaches gpustack-ota, or to resend one that did not. + +on: + push: + branches: + - main + paths: + - 'gpustack_runner/runner.py.json' + workflow_dispatch: {} + +permissions: + contents: read + +jobs: + announce: + runs-on: ubuntu-latest + timeout-minutes: 5 + # A fork's main is nothing the OTA server publishes. + if: github.repository == 'gpustack/runner' + steps: + - name: Generate dispatch token + id: token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.CI_PRT_GENERATOR_ID }} + private-key: ${{ secrets.CI_PRT_GENERATOR_KEY }} + owner: gpustack + repositories: gpustack-ota + # All a dispatch needs; unset, it inherits every installation permission. + permission-contents: write + + - name: Announce the change + env: + GH_TOKEN: ${{ steps.token.outputs.token }} + run: gh api repos/gpustack/gpustack-ota/dispatches -f event_type=source-changed