-
Notifications
You must be signed in to change notification settings - Fork 1
187 lines (167 loc) · 5.41 KB
/
ci.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: 🚀 Ship
on:
push:
branches:
- main
- nuxt-new
jobs:
setup:
name: Setup 📦
runs-on: ubuntu-20.04
env:
NUXT_TELEMETRY_DISABLED: 1
CYPRESS_INSTALL_BINARY: 0
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Install dependencies 👨🏻💻
run: yarn --frozen-lockfile --non-interactive
# - name: Build 📦
# run: yarn run edgio:build
# env:
# BASE_URL: https://v4.soulection.com
# SUPABASE_URL: ${{secrets.SUPABASE_URL}}
# SUPABASE_KEY: ${{secrets.SUPABASE_KEY}}
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
# SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Cache workspace 📦
uses: actions/cache@v3
id: cache-build
with:
path: |
node_modules
.cache/Cypress
./*
key: ${{ matrix.os }}-node-v${{ matrix.node }}-app-${{ github.sha }}
lint:
name: Lint 🚨
needs: setup
runs-on: ubuntu-20.04
env:
NUXT_TELEMETRY_DISABLED: 1
CI: 1
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Setup node env 🏗
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Cache workspace 📦
uses: actions/cache@v3
id: cache-build
with:
path: |
node_modules
.cache/Cypress
./*
key: ${{ matrix.os }}-node-v${{ matrix.node }}-app-${{ github.sha }}
- name: Run linter 👀
run: yarn lint
# test:
# name: Test 🧪
# needs: setup
# runs-on: ubuntu-20.04
# env:
# NUXT_TELEMETRY_DISABLED: 1
# CI: 1
# TERM: xterm
# steps:
# - name: Checkout 🛎
# uses: actions/checkout@master
# - name: Setup node env 🏗
# uses: actions/[email protected]
# with:
# node-version: 16
# cache: 'yarn'
# - name: Cache workspace 📦
# uses: actions/cache@v3
# with:
# path: |
# node_modules
# .cache/Cypress
# ./*
# key: ${{ matrix.os }}-node-v${{ matrix.node }}-app-${{ github.sha }}
# - name: Install Cypress 🧪
# run: npx cypress install
# - name: Test 🧪
# uses: cypress-io/github-action@v4
# with:
# install: false
# start: yarn edgio run --production
# cache-key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
# env:
# BASE_URL: http://localhost:3001
# SUPABASE_URL: ${{secrets.SUPABASE_URL}}
# SUPABASE_KEY: ${{secrets.SUPABASE_KEY}}
deploy:
needs:
- lint
# - test
env:
NUXT_TELEMETRY_DISABLED: 1
CI: 1
name: Web Deployment 🚀
if: contains(github.ref, 'refs/tags') == false || github.event_name == 'release'
runs-on: ubuntu-20.04
steps:
- name: Check for edgio deploy token 👀
if: env.EDGIO_DEPLOY_TOKEN == ''
run: |
echo You must define the "EDGIO_DEPLOY_TOKEN" secret in GitHub project settings
exit 1
env:
EDGIO_DEPLOY_TOKEN: ${{secrets.EDGIO_DEPLOY_TOKEN}}
- name: Extract branch name 🛠
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_ENV
- name: Checkout 🛎
uses: actions/checkout@master
- name: Cache workspace 📦
uses: actions/cache@v3
id: cache-build
with:
path: |
node_modules
.cache/Cypress
./*
key: ${{ matrix.os }}-node-v${{ matrix.node }}-app-${{ github.sha }}
- name: Configure Google Storage 🛠
run: echo -n ${{ secrets.GCP_SA_KEY }} | base64 --decode > gcloud-key.json
- name: Deploy to edgio 🚀
run: yarn run edgio:deploy ${{'--branch=$BRANCH_NAME' || ''}} --token=$EDGIO_DEPLOY_TOKEN ${{github.event_name == 'push' && env.BRANCH_NAME == 'main' && '--environment=staging' || ''}} ${{github.event_name == 'release' && '--environment=production' || ''}}
env:
EDGIO_DEPLOY_TOKEN: ${{secrets.EDGIO_DEPLOY_TOKEN}}
BASE_URL: https://v4.soulection.com
SUPABASE_URL: ${{secrets.SUPABASE_URL}}
SUPABASE_KEY: ${{secrets.SUPABASE_KEY}}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Tell Sentry 📢
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
deploy-fly:
name: Deploy to Fly 🎈
needs:
- lint
runs-on: ubuntu-latest
concurrency: deploy-group
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}