-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.61 KB
/
ci.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
#
# art.mrzzy.co
# CI Pipeline
#
name: "CI Pipeline"
on: push
env:
NODE_VERSION: "~20.15"
jobs:
lint:
name: "Lint Code"
runs-on: ubuntu-2204
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Node Packages
run: npm ci --include=dev
- name: Lint Code with 'next lint'
run: npx next lint
- name: Lint Code with 'standard'
run: npx standard
test:
name: "Test Code"
runs-on: ubuntu-2204
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Node Packages
run: npm ci --include=dev
- name: Run Tests
run: npx jest --verbose"
build-publish:
name: "Build & Publish Site"
runs-on: ubuntu-2204
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install b2 CLI
run: |
set -exu -o pipefail
sudo curl https://github.com/Backblaze/B2_Command_Line_Tool/releases/latest/download/b2-linux -o /usr/local/bin/b2
sudo chmod a+rw /usr/local/bin/b2
- name: Install Node Packages
run: npm ci --include=dev
- name: Build site
run: npx next build
# TODO(mrzzy): gate deploy with tag
- name: Upload site to b2
env:
B2_APPLICATION_KEY_ID: "${{ secrets.B2_APPLICATION_KEY_ID }}"
B2_APPLICATION_KEY: "${{ secrets.B2_APPLICATION_KEY }}"
run:
b2 sync --delete --replace-newer out/ b2://art-mrzzy-co-site/