Notify: Envio Indexer Deploy #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Notify: Envio Indexer Deploy" | |
| on: | |
| push: | |
| branches: | |
| - deploy/celo-mainnet | |
| - deploy/celo-sepolia | |
| - deploy/monad-mainnet | |
| - deploy/monad-testnet | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: read-all | |
| jobs: | |
| notify: | |
| name: Post Discord reminder | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Determine network | |
| id: meta | |
| run: | | |
| BRANCH="${GITHUB_REF#refs/heads/}" | |
| case "$BRANCH" in | |
| deploy/celo-mainnet) | |
| echo "network=Celo Mainnet" >> $GITHUB_OUTPUT | |
| echo "envio_url=https://envio.dev/app/mento-protocol/mento-v3-celo-mainnet" >> $GITHUB_OUTPUT | |
| ;; | |
| deploy/celo-sepolia) | |
| echo "network=Celo Sepolia" >> $GITHUB_OUTPUT | |
| echo "envio_url=https://envio.dev/app/mento-protocol/mento-v3-celo-sepolia" >> $GITHUB_OUTPUT | |
| ;; | |
| deploy/monad-mainnet) | |
| echo "network=Monad Mainnet" >> $GITHUB_OUTPUT | |
| echo "envio_url=https://envio.dev/app/mento-protocol/mento-v3-monad-mainnet" >> $GITHUB_OUTPUT | |
| ;; | |
| deploy/monad-testnet) | |
| echo "network=Monad Testnet" >> $GITHUB_OUTPUT | |
| echo "envio_url=https://envio.dev/app/mento-protocol/mento-v3-monad-testnet" >> $GITHUB_OUTPUT | |
| ;; | |
| esac | |
| - name: Post to Discord thread | |
| env: | |
| DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }} | |
| THREAD_ID: "1476243867832549489" | |
| NETWORK: ${{ steps.meta.outputs.network }} | |
| ENVIO_URL: ${{ steps.meta.outputs.envio_url }} | |
| COMMIT: ${{ github.sha }} | |
| ACTOR: ${{ github.actor }} | |
| run: | | |
| SHORT_SHA="${COMMIT:0:7}" | |
| MESSAGE="🚀 **Envio indexer deploying — $NETWORK** (commit \`$SHORT_SHA\` by $ACTOR)\n\n📊 Track sync progress: $ENVIO_URL" | |
| curl -sf -X POST "https://discord.com/api/v10/channels/$THREAD_ID/messages" \ | |
| -H "Authorization: Bot $DISCORD_BOT_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| -d "{\"content\": \"$MESSAGE\"}" |