-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (75 loc) · 2.42 KB
/
thegraph_dev_deploy.yml
File metadata and controls
86 lines (75 loc) · 2.42 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: The Graph - Manual Deployment to Dev
on:
workflow_dispatch:
inputs:
network:
description: "Network for Subgraph deployment - Ethereum Mainnet (Mainnet) or Gnosis Chain (Gnosis)"
required: true
options:
- mainnet
- gnosis
type: choice
type:
description: "Brige type: Home or Foreign"
required: true
options:
- home
- foreign
type: choice
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Deployment
runs-on: ubuntu-latest
outputs:
random_id: ${{ steps.random_id.outputs.random_id }}
env:
DEPLOY_API_KEY: ${{ secrets.THEGRAPH_DEPLOY_API_KEY }}
TYPE: ${{ inputs.type }}
NETWORK: ${{ inputs.network }}
DEBUG: true
SUBGRAPH_NAME: gbc-bridge-${{ inputs.network }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Check for excluded branches
if: startsWith(github.ref, 'refs/heads/main')
run: |
echo "This branch is excluded from workflow dispatch."
exit 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies & build subgraphs
run: |
cd subgraph
yarn install
yarn codegen
yarn build
- name: Generate Random ID
id: random_id
run: |
echo "random_id=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT
- name: Deploy Subgraphs
env:
SUBGRAPH_LABELS: "${{ github.ref_name }}-${{ steps.random_id.outputs.random_id }}"
run: |
cd subgraph
yarn deploy
notify:
uses: ./.github/workflows/slack_release_notification.yml
if: ${{ always() }}
needs: deploy
secrets:
RELEASES_SLACK_WEBHOOK_URL: ${{ secrets.RELEASES_SLACK_WEBHOOK_URL }}
with:
environment: Development
service: Bridge Monitor SubGraph
success: ${{ contains(join(needs.*.result, ','), 'success') }}
message: "deploy service `Bridge Monitor SubGraph` version `${{ github.ref_name }}-${{ needs.deploy.outputs.random_id }}`. Triggered by `${{ github.actor }}`."