-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (50 loc) · 1.94 KB
/
ci_main.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
name: CI Main
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
env:
BASE: ${{ github.ref == 'refs/heads/main' && 'origin/main~1' || 'origin/main' }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Create env file
run: |
touch .env
echo NX_RIVET_KEY=${{ secrets.NX_RIVET_KEY }} >> .env
echo NX_ETHERSCAN_KEY=${{ secrets.NX_ETHERSCAN_KEY }} >> .env
echo NX_ARBISCAN_KEY=${{ secrets.NX_ARBISCAN_KEY }} >> .env
echo NX_GNOSISSCAN_KEY=${{ secrets.NX_GNOSISSCAN_KEY }} >> .env
echo NX_POLYGONSCAN_KEY=${{ secrets.NX_POLYGONSCAN_KEY }} >> .env
echo NX_OPTIMISMSCAN_KEY=${{ secrets.NX_OPTIMISMSCAN_KEY }} >> .env
echo NX_GRAPH_API_KEY_MAINNET=${{ secrets.NX_GRAPH_API_KEY_MAINNET }} >> .env
echo NX_WALLET_CONNECT_ID=${{ secrets.NX_WALLET_CONNECT_ID }} >> .env
echo NX_BASESCAN_KEY=${{ secrets.NX_BASESCAN_KEY }} >> .env
- name: Install dependencies
run: yarn install
- name: Lint mono
run: npx nx affected:lint --base $BASE
- name: Build mono
run: npx nx affected:build --base $BASE
- name: Publish to cloudflare pages
if: ${{ github.ref == 'refs/heads/main' }}
run: |
npx nx affected --target cloudflareProduction --base $BASE
- name: NPM Publish
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo '//registry.npmjs.org/:_authToken=${{secrets.NPM_AUTH_TOKEN}}' > .npmrc
npx nx affected --target npmPublish --base $BASE --otp ${{ secrets.NPM_AUTH_TOKEN }} --tag latest