Skip to content

Update ci-cd.dev.yml #5

Update ci-cd.dev.yml

Update ci-cd.dev.yml #5

Workflow file for this run

# name: CI/CD Test Pipeline
# on:
# push:
# branches:
# - test
# pull_request:
# branches:
# - test
# env:
# ENVIRONMENT: test
# DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
# NEXTAUTH_SECRET: ${{ secrets.TEST_NEXTAUTH_SECRET }}
# NEXT_PUBLIC_SITE_URL: http://test.ismail-mouyahada.com
# NEXT_PUBLIC_SOCKET_URL: ws://test-socket.ismail-mouyahada.com
# jobs:
# deps-vulnerability:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run dependency vulnerability scan
# uses: advanced-security/npm-audit-action@v1
# lint:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run Linting
# run: npm run lint
# unit-tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run Jest Unit Tests
# run: npm run test:watch
# codecov:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run tests and generate coverage report
# run: npm run test -- --coverage
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# security:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Run security analysis
# uses: github/codeql-action/analyze@v2
# lighthouse:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run Lighthouse CI
# run: npx lhci autorun
# docker-build:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Login to GitHub Container Registry
# run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# - name: Build Docker image
# run: docker build -t ghcr.io/ismail-mouyahada/sat-square:test-${{ github.sha }} -f Dockerfile.test .
# - name: Scan Docker image for vulnerabilities
# uses: aquasecurity/[email protected]
# with:
# image-ref: ghcr.io/ismail-mouyahada/sat-square:test-${{ github.sha }}
# - name: Push Docker image to GitHub Container Registry
# run: docker push ghcr.io/ismail-mouyahada/sat-square:test-${{ github.sha }}
# e2e-tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run end-to-end tests
# run: npm run test:e2e
# stress-test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Install dependencies
# run: npm install
# - name: Run stress tests
# run: npm run test:stress
# notify:
# runs-on: ubuntu-latest
# needs: [deps-vulnerability, lint, unit-tests, codecov, security, lighthouse, docker-build, e2e-tests, stress-test]
# steps:
# - name: Send Discord notification on success
# if: success()
# run: |
# curl -X POST -H "Content-Type: application/json" \
# -d '{"content": "CI/CD Test Pipeline succeeded!"}' \
# ${{ secrets.DISCORD_WEBHOOK_URL }}
# - name: Send Discord notification on failure
# if: failure()
# run: |
# curl -X POST -H "Content-Type: application/json" \
# -d '{"content": "CI/CD Test Pipeline failed!"}' \
# ${{ secrets.DISCORD_WEBHOOK_URL }}