Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

okknkldx #124

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/cd-oidc.yaml

This file was deleted.

98 changes: 0 additions & 98 deletions .github/workflows/cd.yaml

This file was deleted.

113 changes: 75 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,93 @@
name: Continuous Integration Workflow
name: Node.js CI/CD Pipeline

# This workflow is triggered whenever a new PR is created on the main branch
# Trigger the workflow on push to main or pull request
on:
pull_request:
push:
branches:
- main
paths:
- 'web/**'
push:
pull_request:
branches:
- main
paths:
- 'web/**'

# Define the jobs in the workflow
jobs:
build:
runs-on: ubuntu-latest # The environment to run the job

# Run unit tests to make sure everything is 👍
test:
name: 'Run unit tests'
defaults:
run:
shell: bash
# Define the working directory for all run steps in the workflow
working-directory: ./web
# Specify the OS we want the workflow to run on
runs-on: ubuntu-latest
# Define the steps for this job
# The steps for the build job
steps:
- uses: actions/checkout@v2
name: 'Checkout repository'
# Checkout the repository code
- name: Checkout code
uses: actions/checkout@v3

- name: 'Install Dependencies'
run: npm install

- name: 'Run Tests'
run: npm run test
# Set up the required Node.js version
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"

# Install dependencies
- name: Install dependencies
run: npm install

# Run tests
- name: Run tests
run: npm run test

# Build the application (if applicable)
- name: Build the application
run: npm run build

# Run the linter to check for code style issues
lint:
name: 'Run linter'
defaults:
run:
shell: bash
# Define the working directory for all run steps in the workflow
working-directory: ./web
runs-on: ubuntu-latest # Corrected 'runs-on'
name: 'Linting'

steps:
# Checkout the repository code
- name: Checkout code
uses: actions/checkout@v3

# Set up the required Node.js version
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"

# Install dependencies
- name: Install dependencies
run: npm install
working-directory: ./web # Corrected placement of working-directory

# Run linting
- name: Linting
run: npx standard -v
working-directory: ./web # Corrected placement of working-directory

deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: 'Checkout repository'

- name: 'Install Dependencies'
run: npm install

- name: 'Run Linter'
run: npx standard -v
needs: ['build', 'lint'] # Ensures the build and lint jobs pass before running deployment

steps:
- name: Checkout code
uses: actions/checkout@v3

# Set up Node.js (same as the build job)
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20.x"

# Install dependencies (again in the deploy step)
- name: Install dependencies
run: npm install

# Deploy the app (this can be done via SSH, FTP, or other deployment strategies)
- name: Deploy to production server
run: |
ssh [email protected] 'cd ./web && git pull && npm install && npm run build && pm2 restart app'
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
66 changes: 0 additions & 66 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/interactions.yaml

This file was deleted.

Loading