Skip to content

Commit

Permalink
init nextjs image build
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Aug 23, 2024
1 parent 0c2f926 commit 898604b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/apps-nextjs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CD / App

on:
pull_request:
branches: ["*"]
paths:
- apps/nextjs/**
- packages/**
- .github/workflows/apps-nextjs.yaml
- pnpm-lock.yaml
push:
branches: ["main"]
paths:
- apps/nextjs/**
- packages/**
- .github/workflows/apps-nextjs.yaml
- pnpm-lock.yaml

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ctrlplane/app
tags: |
type=sha,format=short,prefix=
- name: Build
uses: docker/build-push-action@v6
if: github.ref != 'refs/heads/main'
with:
push: false
file: apps/nextjs/Dockerfile
tags: ${{ steps.meta.outputs.tags }}

- name: Build and Push
uses: docker/build-push-action@v6
if: github.ref == 'refs/heads/main'
with:
push: true
file: apps/nextjs/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"zod": "catalog:"
},
"peerDependencies": {
"react": "18.3.1",
"react": "catalog:react18",
"zod": "catalog:"
},
"prettier": "@ctrlplane/prettier-config"
Expand Down

0 comments on commit 898604b

Please sign in to comment.