-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (62 loc) · 2.37 KB
/
deploy.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
67
68
69
70
name: 'Deploy'
on:
push:
branches:
- main
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
inputs:
endpoint:
description: 'endpoint used to deploy contracts'
default: https://polygon-mumbai.infura.io/v3/4458cf4d1689497b9a38b1d6bbf05e78
required: true
network:
type: choice
description: 'network used to publish contracts'
default: testnet
required: true
options:
- testnet
jobs:
Deploy-Contracts:
name: Deploy-Contracts
if: "startsWith(github.event.head_commit.message, '[deploy-testnet]') && github.repository == 'subquery/network-contracts' || github.event_name == 'workflow_dispatch'"
runs-on: ubuntu-latest
env:
SEED: ${{ secrets.SEED }}
steps:
#Check out
- uses: actions/checkout@v2
with:
fetch-depth: 100
- uses: actions/setup-node@v1
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: yarn
- name: Bump & Build
run: npm version prerelease --no-git-tag-version && yarn build
# Deploy contracts
- name: Deploy contracts
run: yarn deploy --${{ github.event.inputs.network }} && scripts/copy_deployment_json.sh # Uses SEED env var
env:
ENDPOINT: ${{ github.event.inputs.endpoint }}
DEPLOY_PRINT: true
- name: Setup contracts
run: yarn setup --${{ github.event.inputs.network }}
- uses: JS-DevTools/npm-publish@v1
name: Publish
with:
token: ${{ secrets.NPM_TOKEN }}
tag: latest
access: public
package: build/build/package.json
# Commit updated contract addresses, this should trigger the prerelease action
- name: Commit changes
uses: EndBug/add-and-commit@v5
with:
add: publish/*.json package.json
message: '[SKIP CI] Deploy to testnet and Prerelease'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}