Skip to content

Commit 3ac7ae5

Browse files
committed
Use shared github action for checkout/install
1 parent 6af10f3 commit 3ac7ae5

File tree

4 files changed

+21
-28
lines changed

4 files changed

+21
-28
lines changed

.github/actions/check/action.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@ description: "Install dependencies and run formatting, linting, type checking, a
44
runs:
55
using: "composite"
66
steps:
7-
- name: Setup Bun
8-
uses: oven-sh/setup-bun@v2
9-
with:
10-
bun-version: latest
11-
12-
- name: Install dependencies
13-
shell: bash
14-
run: bun install --frozen-lockfile --prefer-offline
7+
- name: Setup environment
8+
uses: ./.github/actions/setup
159

1610
- name: Run checks
1711
shell: bash

.github/actions/setup/action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Setup Node and Dependencies"
2+
description: "Checkout code, setup Bun, and install dependencies"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Checkout code
8+
uses: actions/checkout@v5
9+
10+
- name: Setup Bun
11+
uses: oven-sh/setup-bun@v2
12+
with:
13+
bun-version: latest
14+
15+
- name: Install dependencies
16+
shell: bash
17+
run: bun install --frozen-lockfile --prefer-offline

.github/workflows/check.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ jobs:
1212
check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v5
1615
- uses: ./.github/actions/check

.github/workflows/deploy.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
if: github.event.action != 'closed'
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v5
1615
- uses: ./.github/actions/check
1716

1817
# Deploy preview environment on PRs
@@ -27,15 +26,7 @@ jobs:
2726
preview-url: ${{ steps.deploy.outputs.deployment-url }}
2827
db-name: ${{ steps.setup-db.outputs.db-name }}
2928
steps:
30-
- uses: actions/checkout@v4
31-
32-
- name: Setup Bun
33-
uses: oven-sh/setup-bun@v2
34-
with:
35-
bun-version: latest
36-
37-
- name: Install dependencies
38-
run: bun install --frozen-lockfile
29+
- uses: ./.github/actions/setup
3930

4031
- name: Setup preview database and run migrations
4132
id: setup-db
@@ -154,15 +145,7 @@ jobs:
154145
name: production
155146
url: ${{ vars.BETTER_AUTH_URL }}
156147
steps:
157-
- uses: actions/checkout@v4
158-
159-
- name: Setup Bun
160-
uses: oven-sh/setup-bun@v2
161-
with:
162-
bun-version: latest
163-
164-
- name: Install dependencies
165-
run: bun install --frozen-lockfile
148+
- uses: ./.github/actions/setup
166149

167150
- name: Run database migrations
168151
uses: cloudflare/wrangler-action@v3

0 commit comments

Comments
 (0)