Separate CI/CD workflows for clarity
Some checks failed
CI/CD Pipeline (Simple) / production (push) Failing after 7m52s
Some checks failed
CI/CD Pipeline (Simple) / production (push) Failing after 7m52s
- Split CI/CD into two distinct workflows: - 'Test and Build' for main branch (testing only) - 'CI/CD Pipeline' for production branch (full deployment) - Remove duplicate test-and-build job from production workflow - Each workflow now has a single, clear purpose - Eliminates confusion with multiple job views in Gitea
This commit is contained in:
@@ -12,37 +12,6 @@ env:
|
|||||||
CONTAINER_NAME: portfolio-app
|
CONTAINER_NAME: portfolio-app
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Single job that does everything for non-production branches
|
|
||||||
test-and-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.ref != 'refs/heads/production'
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Run linting
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: npm run test
|
|
||||||
|
|
||||||
- name: Build application
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Run security scan
|
|
||||||
run: |
|
|
||||||
echo "🔍 Running npm audit..."
|
|
||||||
npm audit --audit-level=high || echo "⚠️ Some vulnerabilities found, but continuing..."
|
|
||||||
|
|
||||||
# Production deployment pipeline
|
# Production deployment pipeline
|
||||||
production:
|
production:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
40
.gitea/workflows/test-and-build.yml
Normal file
40
.gitea/workflows/test-and-build.yml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Test and Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
NODE_VERSION: '20'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-and-build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run linting
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Build application
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Run security scan
|
||||||
|
run: |
|
||||||
|
echo "🔍 Running npm audit..."
|
||||||
|
npm audit --audit-level=high || echo "⚠️ Some vulnerabilities found, but continuing..."
|
||||||
Reference in New Issue
Block a user