diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..be98a2d --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,34 @@ +name: CI/CD for React App + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: npm install + + - name: Build Project + run: npm run build + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@4.1.0 + with: + branch: gh-pages + folder: build