Skip to content

Commit

Permalink
Adding dispatch for auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-at-algo committed Oct 30, 2024
1 parent d909717 commit ce81455
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/update-dev-portal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Trigger Documentation Build

on:
push:
branches:
- master
- staging

jobs:
trigger-build:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.BOT_ID }}
private-key: ${{ secrets.BOT_SK }}

- name: Trigger documentation build
run: |
# Set environment based on branch
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
ENV="production"
else
ENV="staging"
fi
# Trigger repository_dispatch event
curl -X POST \
-H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"event_type\": \"docs_update\", \"client_payload\": {\"ref\": \"${{ github.ref }}\", \"environment\": \"$ENV\"}}" \
https://api.github.com/repos/algorandfoundation/algorand-developer-portal/dispatches
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ ENV/
env.bak/
venv.bak/
.vscode/
.idea

0 comments on commit ce81455

Please sign in to comment.