Skip to content

Commit

Permalink
break nx command into 2 separate commands
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Dubrick <[email protected]>
  • Loading branch information
Jdubrick committed Jun 6, 2024
1 parent fedf3f4 commit c8ef2d3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,14 @@ jobs:
run: |
yarn install --frozen-lockfile
- name: Docker Build
- name: Docker Build for linux/amd64
run: |
yarn nx affected --target=docker-build --parallel=4
yarn nx affected --target=docker-build-amd64 --parallel=3
- name: Docker Build for linux/arm64
run: |
yarn nx affected --target=docker-build-arm64 --parallel=3
e2e:
name: E2E
Expand Down
13 changes: 10 additions & 3 deletions apps/landing-page/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@
"command": "cd ./apps/landing-page/ && next-sitemap --config ./next-sitemap.config.mjs && cp -a ./dist/public/. ./dist/exported"
}
},
"docker-build": {
"docker-build-amd64": {
"executor": "nx:run-commands",
"description": "Build a multi-architecture image",
"description": "Build docker image for the linux/amd64 architecture",
"options": {
"command": "docker buildx create --name landing-builder && docker buildx use landing-builder && docker buildx build --platform=linux/amd64,linux/arm64 -t nextjs-docker . --build-arg PROJECT_NAME=landing-page && docker buildx rm landing-builder"
"command": "docker build --platform=linux/amd64 -t nextjs-docker-amd64 . --build-arg PROJECT_NAME=landing-page"
}
},
"docker-build-arm64": {
"executor": "nx:run-commands",
"description": "Build docker image for the linux/arm64 architecture",
"options": {
"command": "docker build --platform=linux/arm64 -t nextjs-docker-arm64 . --build-arg PROJECT_NAME=landing-page"
}
},
"test": {
Expand Down
13 changes: 10 additions & 3 deletions apps/registry-viewer/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,18 @@
"command": "cd ./apps/registry-viewer/ && next-sitemap --config ./next-sitemap.config.mjs && cp -a ./dist/public/. ./dist/exported"
}
},
"docker-build": {
"docker-build-amd64": {
"executor": "nx:run-commands",
"description": "Build a multi-architecture image",
"description": "Build docker image for the linux/amd64 architecture",
"options": {
"command": "docker buildx create --name viewer-builder && docker buildx use viewer-builder && docker buildx build --platform=linux/amd64,linux/arm64 -t nextjs-docker . --build-arg PROJECT_NAME=registry-viewer && docker buildx rm viewer-builder"
"command": "docker build --platform=linux/amd64 -t nextjs-docker-amd64 . --build-arg PROJECT_NAME=registry-viewer"
}
},
"docker-build-arm64": {
"executor": "nx:run-commands",
"description": "Build docker image for the linux/arm64 architecture",
"options": {
"command": "docker build --platform=linux/arm64 -t nextjs-docker-arm64 . --build-arg PROJECT_NAME=registry-viewer"
}
},
"test": {
Expand Down

0 comments on commit c8ef2d3

Please sign in to comment.