forked from TuanManhCao/digital-garden
-
-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (98 loc) · 3.13 KB
/
lint-and-build.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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Lint and build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
check-kotlin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate gradle-wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Lint
uses: musichin/ktlint-check@v2
with:
ktlint-version: '0.48.0'
patterns: |
./kotlin/**/**.kt
!./kotlin/**/generated/**
check-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: biomejs/setup-biome@v2
- name: Run Biome
run: biome ci src
lint-and-build:
needs: [ check-kotlin, check-typescript ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
build-root-directory: kotlin
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup next cache
with:
path: |
${{ github.workspace }}/.next/cache
${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-next-store-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-next-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install
- name: Download template contents
run: |
curl -L -o temp.zip https://github.com/turtton/volglass-docs/archive/refs/heads/main.zip
7z x temp.zip
cp -r volglass-docs-main/posts .
- name: Build
run: pnpm run build
build-docker:
needs: check-kotlin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download template contents
run: |
curl -L -o temp.zip https://github.com/turtton/volglass-docs/archive/refs/heads/main.zip
7z x temp.zip
cp -r volglass-docs-main/posts .
- name: Build
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
push: false
context: .