-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.64 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-22.04
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-22.04
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 --passWithNoTests
build-publish:
name: "Build & Publish Site"
runs-on: ubuntu-22.04
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 -L https://github.com/Backblaze/B2_Command_Line_Tool/releases/download/v4.0.3/b2-linux -o /usr/local/bin/b2
sudo chmod a+rx /usr/local/bin/b2
- name: Install Node Packages
run: npm ci --include=dev
- name: Build site
run: npm run build
- name: Upload site to b2
if: ${{ github.ref == 'refs/heads/main' }}
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/