-
Notifications
You must be signed in to change notification settings - Fork 10
163 lines (131 loc) · 4.59 KB
/
frontend.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI-Frontend
on:
pull_request:
branches:
- main
paths:
- "packages/frontend/**"
push:
branches:
- main
paths:
- "packages/frontend/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
jobs:
lint:
name: Run Linters
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: yarn workspace @x-fuji/frontend install
- run: yarn workspace @x-fuji/frontend run lint
- run: yarn workspace @x-fuji/frontend run prettier --check
# deploy-pr:
# name: Deploy Staging for PR
# if: github.ref != 'refs/heads/main'
# permissions:
# contents: "read"
# id-token: "write"
# pull-requests: write
# runs-on: "ubuntu-latest"
# strategy:
# matrix:
# node-version: [18.x]
# steps:
# - uses: "actions/checkout@v3"
# - name: Use Node ${{ matrix.node }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# cache: "yarn"
# - name: Install deps and build (with cache)
# uses: bahmutov/npm-install@v1
# - uses: "google-github-actions/auth@v0"
# with:
# workload_identity_provider: "${{ secrets.WIF_PROVIDER_NAME }}"
# service_account: "${{ secrets.APPENGINE_DEPLOY_SA_EMAIL }}"
# - name: Find PR number
# uses: jwalton/gh-find-current-pr@v1
# id: findPr
# - name: Add service name with PR and env variables
# run: |
# echo service: v2-staging-${{ steps.findPr.outputs.pr }} >> frontend-app.yaml
# echo NEXT_PUBLIC_INFURA_KEY=${{ secrets.INFURA_ID }} >> packages/frontend/.env
# echo NEXT_PUBLIC_WALLET_CONNECT_V2_KEY=${{ secrets.WALLET_CONNECT_V2_KEY }} >> packages/frontend/.env
# echo NEXT_PUBLIC_APP_ENV=development >> packages/frontend/.env
# - name: Build
# run: yarn workspace @x-fuji/frontend build
# - name: Deploy
# id: "deploy"
# uses: "google-github-actions/deploy-appengine@v0"
# with:
# deliverables: "frontend-app.yaml"
# - name: Show output
# run: "echo ${{ steps.deploy.outputs.url }}"
# - name: Post comment with staging url
# uses: mshick/add-pr-comment@v1
# with:
# message: |
# **Please test this PR on:** ${{ steps.deploy.outputs.url }}
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# repo-token-user-login: "github-actions[bot]" # The user.login for temporary GitHub tokens
# allow-repeats: false
# deploy-main:
# name: Deploy Main Staging
# if: github.ref == 'refs/heads/main'
# permissions:
# contents: "read"
# id-token: "write"
# pull-requests: write
# runs-on: "ubuntu-latest"
# strategy:
# matrix:
# node-version: [18.x]
# steps:
# - uses: "actions/checkout@v3"
# - name: Use Node ${{ matrix.node }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node }}
# cache: "yarn"
# - name: Install deps and build (with cache)
# uses: bahmutov/npm-install@v1
# - uses: "google-github-actions/auth@v0"
# with:
# workload_identity_provider: "${{ secrets.WIF_PROVIDER_NAME }}"
# service_account: "${{ secrets.APPENGINE_DEPLOY_SA_EMAIL }}"
# - name: Add service name with PR and env variables
# run: |
# echo service: v2-staging-main >> frontend-app.yaml
# echo NEXT_PUBLIC_INFURA_KEY=${{ secrets.INFURA_ID }} >> packages/frontend/.env
# echo NEXT_PUBLIC_WALLET_CONNECT_V2_KEY=${{ secrets.WALLET_CONNECT_V2_KEY }} >> packages/frontend/.env
# echo NEXT_PUBLIC_APP_ENV=production >> packages/frontend/.env
# - name: Build
# run: yarn workspace @x-fuji/frontend build
# - name: Deploy
# id: "deploy"
# uses: "google-github-actions/deploy-appengine@v0"
# with:
# deliverables: "frontend-app.yaml"
# - name: Create Sentry release
# uses: getsentry/action-release@v1
# env:
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: fuji-dao
# SENTRY_PROJECT: fuji-v2
# # SENTRY_URL: https://sentry.io/
# with:
# environment: production
# sourcemaps: 'packages/frontend/.next/static/chunks'