-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (52 loc) · 1.6 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
name: CI
on:
push:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- uses: pnpm/action-setup@v4
with:
version: 9
- id: get-store-path
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: nextjs-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
nextjs-
nextjs-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Build
run: pnpm build
deploy:
needs: [check]
runs-on: ubuntu-latest
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONTAINER_NAME: visualization
steps:
- uses: actions/checkout@v4
- name: Login into registry
run: echo $GITHUB_TOKEN | docker login ghcr.io -u $USERNAME --password-stdin
- name: Build Docker image
run: docker build -t ghcr.io/${{ github.repository }}/$CONTAINER_NAME:latest .
- name: Push to registry
run: docker push ghcr.io/${{ github.repository }}/$CONTAINER_NAME:latest