forked from JackHamer09/zksync-plus
-
Notifications
You must be signed in to change notification settings - Fork 56
110 lines (95 loc) · 2.87 KB
/
release.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
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
106
107
108
109
110
name: Publish Release
"on":
push:
branches:
- main
- '[0-9]+.*'
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
outputs:
releaseVersion: ${{ steps.release.outputs.releaseVersion }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: |
npm ci --force
- name: Lint
run: |
npm run lint
- name: Release
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VITE_FIREBASE_PROJECT_ID=zksync-dapp-wallet-v2 \
npx semantic-release || true
docker:
name: Build Docker
runs-on: ubuntu-latest
needs: publish
if: ${{ github.ref == 'refs/heads/main' && needs.publish.outputs.releaseVersion != '' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
push: true
tags: |
matterlabs/dapp-portal:latest
matterlabs/dapp-portal:${{ needs.publish.outputs.releaseVersion }}
file: Dockerfile
no-cache: true
staging:
name: Deploy to Staging
runs-on: ubuntu-latest
needs: publish
if: ${{ github.ref == 'refs/heads/main' && needs.publish.outputs.releaseVersion != '' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: |
npm ci --force
- name: Setup .env
run: |
echo "WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}" > .env
echo "ANKR_TOKEN=${{ secrets.ANKR_TOKEN }}" >> .env
echo "SCREENING_API_URL=${{ secrets.SCREENING_API_URL }}" >> .env
echo "DATAPLANE_URL=${{ secrets.DATAPLANE_URL }}" >> .env
echo "RUDDER_KEY=${{ secrets.RUDDER_KEY }}" >> .env
- name: Build
run: |
npm run generate
- name: Deploy
uses: matter-labs/action-hosting-deploy@main
id: deploy
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_STAGING_ZKSYNC_DAPP_WALLET_V2 }}"
projectId: staging-zksync-dapp-wallet-v2
channelID: live