-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 2.15 KB
/
notify-envio-deploy.yml
File metadata and controls
61 lines (55 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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\"}"