diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5012c59..cd343fe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,10 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + # Receive GitHub Actions event from "sev-2/raiden" repository. + repository_dispatch: + types: [update-repo] + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read @@ -23,11 +27,23 @@ jobs: # Build job build: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 # Not needed if lastUpdated is not enabled + - name: Update Raiden version when triggered from "sev-2/raiden" repository. + if: "${{ github.event.client_payload.RAIDEN_VERSION }}" + run: | + RAIDEN_VERSION="${{ github.event.client_payload.RAIDEN_VERSION }}" + echo "{\"version\": \"$RAIDEN_VERSION\"}" > ./public/latest.json + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + git add ./public/latest.json + git commit -m "Update Raiden version to $RAIDEN_VERSION" + git push origin master - name: Setup Node uses: actions/setup-node@v4 with: