-
Notifications
You must be signed in to change notification settings - Fork 41
68 lines (56 loc) · 1.8 KB
/
deploy-production.yml
File metadata and controls
68 lines (56 loc) · 1.8 KB
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
name: Deploy to Production
on:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
run-migrations:
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 15
environment: production
steps:
- name: Checkout code
uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
lfs: true
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- name: Setup Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Drizzle migrations
env:
NODE_ENV: production
POSTGRES_URL: ${{ secrets.POSTGRES_MIGRATION_URL }}
DATABASE_CA: ${{ secrets.DATABASE_CA }}
run: pnpm run drizzle migrate
check-kiloclaw-changes:
runs-on: ${{ vars.RUNNER_DEFAULT_LABEL || 'ubuntu-latest' }}
timeout-minutes: 5
outputs:
changed: ${{ steps.changes.outputs.kiloclaw }}
steps:
- name: Checkout code
uses: useblacksmith/checkout@41cdeedae8edb2e684ba22896a5fd2a3cb85db6b # v1
with:
fetch-depth: 0
- name: Check for kiloclaw changes
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
id: changes
with:
filters: |
kiloclaw:
- 'services/kiloclaw/**'
deploy-kiloclaw:
needs: [check-kiloclaw-changes]
if: needs.check-kiloclaw-changes.outputs.changed == 'true'
uses: ./.github/workflows/deploy-kiloclaw.yml
secrets: inherit