Skip to content

Commit 08c9410

Browse files
committed
use depot
1 parent 6e3797a commit 08c9410

3 files changed

Lines changed: 87 additions & 154 deletions

File tree

.depot/workflows/cicd.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: ci&cd
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
ci:
18+
runs-on: depot-ubuntu-24.04
19+
20+
steps:
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
with:
23+
persist-credentials: false
24+
25+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
26+
with:
27+
node-version: 26
28+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
29+
with:
30+
cache: true
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- parallel:
36+
- name: build
37+
run: node --run build
38+
- name: build docs
39+
run: node --run docs
40+
- name: lint
41+
run: node --run lint
42+
- name: check formatting
43+
run: node --run lint:fmt
44+
- name: test
45+
env:
46+
NODE_ENV: test
47+
run: node --run test
48+
- name: typecheck
49+
run: node --run typecheck
50+
51+
docker:
52+
needs: [ci]
53+
runs-on: depot-ubuntu-24.04
54+
permissions:
55+
contents: read
56+
packages: write
57+
id-token: write
58+
59+
steps:
60+
- name: Docker meta
61+
id: meta
62+
uses: docker/metadata-action@80c7e94dd9b9319bd5eb7a0e0fe9291e23a2a2e9 # v6.1.0
63+
with:
64+
images: |
65+
ghcr.io/${{ github.repository }}
66+
tags: |
67+
type=raw,value={{sha}}
68+
type=raw,value=latest
69+
70+
- name: Login to GHCR
71+
if: github.ref == 'refs/heads/main'
72+
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
73+
with:
74+
registry: ghcr.io
75+
username: ${{ github.actor }}
76+
password: ${{ secrets.GITHUB_TOKEN }}
77+
78+
- name: Build and maybe Push Docker image
79+
uses: depot/build-push-action@98e78adca7817480b8185f474a400b451d74e287 # v1.18.0
80+
with:
81+
project: ks849krng9
82+
platforms: linux/amd64,linux/arm64
83+
push: ${{ github.ref == 'refs/heads/main' }}
84+
tags: ${{ steps.meta.outputs.tags }}
85+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/cicd.yml

Lines changed: 0 additions & 152 deletions
This file was deleted.

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN corepack enable
2323
RUN corepack prepare --activate
2424

2525
# Install dependencies
26-
RUN --mount=type=cache,id=s/c47f3895-fff0-42c4-b1f7-cee7f61e6613-pnpm,target=/pnpm/store \
26+
RUN --mount=type=cache,target=/pnpm/store \
2727
pnpm install --frozen-lockfile --ignore-scripts
2828

2929
FROM base_deps AS build
@@ -37,7 +37,7 @@ FROM base_deps AS docs
3737

3838
COPY docs/openapi.yaml docs/openapi.yaml
3939

40-
RUN --mount=type=cache,id=s/c47f3895-fff0-42c4-b1f7-cee7f61e6613-pnpm,target=/pnpm/store \
40+
RUN --mount=type=cache,target=/pnpm/store \
4141
node --run docs
4242

4343
FROM base

0 commit comments

Comments
 (0)