-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_check.txt
36 lines (29 loc) · 952 Bytes
/
build_check.txt
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
name: Docker Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code from the repository
- name: Checkout repository
uses: actions/checkout@v2
# Step 2: Set up Docker Buildx for multi-platform builds (optional)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 3: Build the Docker image
- name: Build Docker image with pnpm
run: docker build -t my-nextjs-app .
# Step 4: (Optional) Run Docker container for testing
- name: Run Docker container
run: docker run -d -p 3000:3000 --name my-nextjs-app my-nextjs-app
# Step 5: Verify the container is running (Optional)
- name: Test if container is running
run: |
sleep 5 # Wait for the container to start
curl -f http://localhost:3000 || exit 1