-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (91 loc) · 2.64 KB
/
client-ui.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
name: Client UI
on:
push:
branches:
- main
paths:
- client-ui/**
- .github/workflows/client-ui.yml
pull_request:
branches:
- main
paths:
- client-ui/**
- .github/workflows/client-ui.yml
defaults:
run:
working-directory: ./client-ui
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: pnpm/action-setup@v4.0.0
with:
package_json_file: client-ui/package.json
- uses: actions/setup-node@v4.1.0
with:
cache: pnpm
cache-dependency-path: client-ui/pnpm-lock.yaml
node-version-file: client-ui/.nvmrc
- run: pnpm install
- run: pnpm run lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: pnpm/action-setup@v4.0.0
with:
package_json_file: client-ui/package.json
- uses: actions/setup-node@v4.1.0
with:
cache: pnpm
cache-dependency-path: client-ui/pnpm-lock.yaml
node-version-file: client-ui/.nvmrc
- run: pnpm install
- run: pnpm run typecheck
build:
name: build ${{ github.ref_name == 'main' && 'and push' || '' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: arkedge/clover-ui
steps:
- uses: actions/checkout@v4.2.2
- uses: docker/setup-buildx-action@v3.8.0
with:
# renovate: datasource=github-releases depName=docker/buildx
version: "v0.19.3"
- uses: docker/login-action@v3.3.0
if: github.ref_name == 'main'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5.6.1
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
tags: |
type=sha,prefix=
type=raw,value=latest
- uses: docker/build-push-action@v6.11.0
id: build-push
with:
context: ./client-ui
push: ${{ github.ref_name == 'main' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: actions/attest-build-provenance@v2.1.0
if: github.ref_name == 'main'
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.build-push.outputs.digest }}
push-to-registry: true