diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..5d38f0f --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,66 @@ +name: CI/CD Pipeline + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + test: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Run tests + run: npm test + + deploy: + runs-on: ubuntu-latest + needs: test + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Deploy to GitHub Pages + run: npm run deploy diff --git a/README.md b/README.md index 5cf7f40..9a2cb6e 100644 --- a/README.md +++ b/README.md @@ -100,3 +100,35 @@ mastery. Explore, play, and witness your progress in the pursuit of precision. Happy coding! ❤️

+ +

CI/CD Process

+

+ This project uses GitHub Actions for Continuous Integration (CI) and Continuous Deployment (CD). The CI/CD pipeline is defined in the .github/workflows/ci-cd.yml file. +

+

Steps in the CI/CD Pipeline

+ +

Running CI/CD Processes Locally

+

+ You can run the CI/CD processes locally using the following commands: +

+ diff --git a/package.json b/package.json index 8b632aa..ea3acb2 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,10 @@ { "dependencies": { "chart.js": "^4.4.0" + }, + "scripts": { + "build": "tsc", + "test": "jest", + "deploy": "gh-pages -d build" } }