-
Notifications
You must be signed in to change notification settings - Fork 79
105 lines (93 loc) · 3.12 KB
/
cd.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Release
on:
push:
branches:
- main
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
VITE_ENV: "ci"
HOSTNAME: "app-ipfs.venus.io"
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.11.1"
cache: "yarn"
- name: Install dependencies
run: yarn
# Bump package versions based on changesets and commit changes to the main branch
- name: Bump package versions
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
run: |
git config user.name toolsvenus
git config user.email tools@venus.io
git fetch origin
git rebase --strategy-option=theirs origin/main
npx changeset version
git add -A
git status
git commit --verbose -a -m "chore: bump package versions" || exit 0
git push
- name: Run tests and collect coverage
run: yarn test --coverage
- name: Build
env:
VITE_NETWORK: "mainnet"
VITE_ENV: "production"
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
VITE_POSTHOG_API_KEY: ${{ secrets.VITE_POSTHOG_API_KEY }}
VITE_POSTHOG_HOST_URL: ${{ secrets.VITE_POSTHOG_HOST_URL }}
VITE_ZYFI_API_KEY: ${{ secrets.VITE_ZYFI_API_KEY }}
VITE_ALCHEMY_API_KEY: ${{ secrets.VITE_ALCHEMY_API_KEY }}
VITE_NODE_REAL_API_KEY: ${{ secrets.VITE_NODE_REAL_API_KEY }}
VITE_THE_GRAPH_API_KEY: ${{ secrets.VITE_THE_GRAPH_API_KEY }}
run: |
# We only build the dApp because the landing page is deployed with Vercel
yarn build --filter=@venusprotocol/evm
- name: Upload to IPFS and pin
id: uploadBuildToIpfs
uses: VenusProtocol/pinata-action@96e90c7a6eb52b60267a323758d89d25bf5e1d72
with:
path: ./apps/evm/build
pinName: ${{ env.HOSTNAME }}
maxPinsToKeep: 20
pinataApiKey: ${{ secrets.PINATA_API_KEY }}
pinataApiSecret: ${{ secrets.PINATA_API_SECRET }}
- name: Update DNS record and purge cache
uses: VenusProtocol/cloudflare-dnslink-action@297058f76eaeb59a95bc6352e7535f49a56ff456
with:
cid: ${{ steps.uploadBuildToIpfs.outputs.cid }}
purge: true
cloudflareHostname: ${{ env.HOSTNAME }}
cloudflareApiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflareZoneId: ${{ secrets.CLOUDFLARE_ZONE_ID }}
- name: Warm up cache
uses: VenusProtocol/globalping-action@f38ac8fef000087c08282a4437b54e398bd6f42a
with:
target: ${{ env.HOSTNAME }}
countryCodes: |
SG
HK
JP
DE
US
BR
GB
FR
SE
AU
IN
IE