-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (52 loc) · 1.85 KB
/
deploy-alchemy.yml
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
name: Deploy to Alchemy
on:
push:
tags:
- "*-*"
env:
NODE_VERSION: 18
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract network from tag
id: extract-network
run: echo "NETWORK=${GITHUB_REF#refs/tags/}" | sed 's/-.*//' >> $GITHUB_OUTPUT
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Yarn
run: npm i -g yarn
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Prepare
run: yarn prepare:${{ steps.extract-network.outputs.NETWORK }}
- name: Codegen
run: yarn codegen
- name: Export Vars
id: export-vars
run: |
NETWORK=${{ steps.extract-network.outputs.NETWORK }}
AAVEGOTCHI_DIAMOND=$(node -e "console.log(require('./config/$NETWORK.json').contracts.diamond)")
echo "AAVEGOTCHI_DIAMOND=$AAVEGOTCHI_DIAMOND" >> $GITHUB_OUTPUT
- name: Generate Constants
run: |
NETWORK=${{ steps.extract-network.outputs.NETWORK }}
npx ts-node scripts/generate-constants.ts $NETWORK
- name: Replace environment variables
run: |
sed -i "s/{{AAVEGOTCHI_DIAMOND}}/${{ steps.export-vars.outputs.AAVEGOTCHI_DIAMOND }}/g" src/helper.ts
- name: Build
run: yarn build
- name: Deploy to Alchemy
env:
SUBGRAPH_NAME: aavegotchi-svg-${{ steps.extract-network.outputs.NETWORK }}
run: |
npx graph deploy ${{ env.SUBGRAPH_NAME }} \
--deploy-key ${{ secrets.SATSUMA_ACCESS_TOKEN }} \
--node https://subgraphs.alchemy.com/api/subgraphs/deploy \
--ipfs https://ipfs.satsuma.xyz \
--version-label ${GITHUB_REF#refs/*/}
shell: bash