-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
74 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": "next/core-web-vitals", | ||
"rules": { "react-hooks/exhaustive-deps": "warn" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 Node.js and install Yarn | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install Yarn | ||
run: corepack enable && corepack prepare yarn@stable --activate | ||
|
||
# Step 3: Install dependencies and build the Next.js app | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Build Next.js app | ||
run: yarn build | ||
|
||
# Step 4: Set up Docker Buildx | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Step 5: Build Docker image | ||
- name: Build Docker image | ||
run: docker build -t webxr . | ||
|
||
# Step 6: Test the Docker container | ||
- name: Run Docker container | ||
run: docker run -d -p 3000:3000 --name webxr webxr | ||
- name: Test if container is running | ||
run: | | ||
sleep 5 # Wait for the container to start | ||
curl -f http://localhost:3000 || exit 1 | ||
# Step 7: Cleanup | ||
- name: Stop and remove Docker container | ||
run: docker stop webxr && docker rm webxr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters