fix: .github files #10
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
name: CI Workflow | ||
on: | ||
push: | ||
branches: ["main", "dev"] | ||
pull_request: | ||
branches: ["main", "dev"] | ||
jobs: | ||
lint: | ||
name: Lint Code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run linter | ||
run: npm run lint | ||
build: | ||
name: Build Project | ||
runs-on: ubuntu-latest | ||
needs: test | ||
Check failure on line 32 in .github/workflows/workflow.yaml GitHub Actions / CI WorkflowInvalid workflow file
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "20" | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build Next.js project | ||
run: npm run build | ||
dockerize: | ||
name: Build Docker Image | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build Docker image | ||
run: | | ||
docker build -t sot . | ||
- name: Run Docker container | ||
run: | | ||
docker run -d -p 3000:3000 sot | ||
- name: Test Docker container | ||
run: | | ||
# Example test to check if the application is running | ||
curl --silent --fail http://localhost:3000 || exit 1 |