Skip to content

Commit 693aa38

Browse files
committed
fix migrations + do docker builds in parallel
1 parent 997b43b commit 693aa38

File tree

3 files changed

+53
-70
lines changed

3 files changed

+53
-70
lines changed

.github/workflows/docker-build-web.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ on:
1111

1212
jobs:
1313
build:
14-
name: Build Docker Image
14+
name: Build Docker Image (${{ matrix.platform }})
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
platform: [amd64, arm64]
19+
fail-fast: false
1620
permissions:
1721
contents: read
1822
packages: write
@@ -21,6 +25,9 @@ jobs:
2125
- name: Checkout Repository
2226
uses: actions/checkout@v4
2327

28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@v3
30+
2431
- name: Set up Docker Buildx
2532
uses: docker/setup-buildx-action@v3
2633

@@ -39,25 +46,39 @@ jobs:
3946
username: ${{ github.actor }}
4047
password: ${{ secrets.GITHUB_TOKEN }}
4148

42-
- name: Prepare Docker Metadata
43-
id: meta
44-
uses: docker/metadata-action@v5
45-
with:
46-
images: ghcr.io/capsoftware/cap-web
47-
tags: |
48-
type=raw,value=${{ inputs.tag || 'latest' }}
49-
50-
- name: Build Docker Image
49+
- name: Build and Push Platform Image
5150
uses: docker/build-push-action@v5
5251
with:
5352
context: .
5453
file: apps/web/Dockerfile
55-
platforms: linux/amd64,linux/arm64
56-
tags: ${{ steps.meta.outputs.tags }}
54+
platforms: linux/${{ matrix.platform }}
5755
push: true
58-
load: false
59-
cache-from: type=gha
60-
cache-to: type=gha,mode=max
56+
tags: ghcr.io/capsoftware/cap-web:${{ inputs.tag || 'latest' }}-${{ matrix.platform }}
57+
cache-from: type=gha,scope=buildx-${{ matrix.platform }}
58+
cache-to: type=gha,mode=max,scope=buildx-${{ matrix.platform }}
59+
60+
merge:
61+
name: Create Multi-Architecture Manifest
62+
needs: build
63+
runs-on: ubuntu-latest
64+
permissions:
65+
contents: read
66+
packages: write
67+
68+
steps:
69+
- name: Set up Docker Buildx
70+
uses: docker/setup-buildx-action@v3
71+
72+
- name: Login to GitHub Container Registry
73+
uses: docker/login-action@v3
74+
with:
75+
registry: ghcr.io
76+
username: ${{ github.actor }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
6178

62-
- name: Show Docker Images
63-
run: docker images
79+
- name: Create and Push Multi-Arch Manifest
80+
run: |
81+
docker buildx imagetools create \
82+
--tag ghcr.io/capsoftware/cap-web:${{ inputs.tag || 'latest' }} \
83+
ghcr.io/capsoftware/cap-web:${{ inputs.tag || 'latest' }}-amd64 \
84+
ghcr.io/capsoftware/cap-web:${{ inputs.tag || 'latest' }}-arm64

packages/database/migrations/meta/_journal.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
{
1313
"idx": 1,
1414
"version": "5",
15-
"when": 1745977344716,
16-
"tag": "0001_eager_the_order",
15+
"when": 1749268354138,
16+
"tag": "0001_white_young_avengers",
1717
"breakpoints": true
1818
},
1919
{

turbo.json

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,22 @@
11
{
22
"$schema": "https://turbo.build/schema.json",
3-
"globalDependencies": [
4-
".env",
5-
".env"
6-
],
7-
"globalEnv": [
8-
"*"
9-
],
3+
"globalDependencies": [".env", ".env"],
4+
"globalEnv": ["*"],
105
"tasks": {
116
"build": {
12-
"inputs": [
13-
"**/*.ts",
14-
"**/*.tsx",
15-
"!src-tauri/**",
16-
"!node_modules/**"
17-
],
18-
"dependsOn": [
19-
"^build"
20-
],
21-
"outputs": [
22-
".next/**",
23-
"!.next/cache/**"
24-
]
7+
"inputs": ["**/*.ts", "**/*.tsx", "!src-tauri/**", "!node_modules/**"],
8+
"dependsOn": ["^build"],
9+
"outputs": [".next/**", "!.next/cache/**"]
2510
},
2611
"build:web:docker": {
27-
"inputs": [
28-
"**/*.ts",
29-
"**/*.tsx",
30-
"!src-tauri/**",
31-
"!node_modules/**"
32-
],
33-
"dependsOn": [
34-
"^build"
35-
],
36-
"outputs": [
37-
".next/**",
38-
"!.next/cache/**"
39-
]
12+
"inputs": ["**/*.ts", "**/*.tsx", "!src-tauri/**", "!node_modules/**"],
13+
"dependsOn": ["^build"],
14+
"outputs": [".next/**", "!.next/cache/**"]
4015
},
4116
"build:web": {
42-
"inputs": [
43-
"**/*.ts",
44-
"**/*.tsx",
45-
"!src-tauri/**",
46-
"!node_modules/**"
47-
],
48-
"dependsOn": [
49-
"^build"
50-
],
51-
"outputs": [
52-
".next/**",
53-
"!.next/cache/**"
54-
]
17+
"inputs": ["**/*.ts", "**/*.tsx", "!src-tauri/**", "!node_modules/**"],
18+
"dependsOn": ["^build"],
19+
"outputs": [".next/**", "!.next/cache/**"]
5520
},
5621
"lint": {
5722
"cache": false
@@ -73,12 +38,9 @@
7338
"cache": false
7439
},
7540
"dev": {
76-
"dependsOn": [
77-
"db:push",
78-
"db:generate"
79-
],
41+
"dependsOn": ["db:push"],
8042
"cache": false,
8143
"persistent": true
8244
}
8345
}
84-
}
46+
}

0 commit comments

Comments
 (0)