From 9cde646dc27a7dd412e68f74a0518b978de58bdd Mon Sep 17 00:00:00 2001 From: Ajay Dhangar <99037494+Ajay-Dhangar@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:30:30 +0530 Subject: [PATCH 1/3] Create deploy.yml --- .github/workflows /deploy.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows /deploy.yml diff --git a/.github/workflows /deploy.yml b/.github/workflows /deploy.yml new file mode 100644 index 0000000..3a544a3 --- /dev/null +++ b/.github/workflows /deploy.yml @@ -0,0 +1,31 @@ +name: Deploy React App to GitHub Pages + +on: + push: + branches: + - main # Trigger deployment when changes are pushed to the main branch + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Build React app + run: npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build From 019868808ac398e80fb1a3db7b5401fee17dfd42 Mon Sep 17 00:00:00 2001 From: Ajay Dhangar <99037494+Ajay-Dhangar@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:34:38 +0530 Subject: [PATCH 2/3] Update deploy.yml --- .github/workflows /deploy.yml | 39 +++++++++++++++-------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows /deploy.yml b/.github/workflows /deploy.yml index 3a544a3..1cd40bd 100644 --- a/.github/workflows /deploy.yml +++ b/.github/workflows /deploy.yml @@ -1,31 +1,26 @@ -name: Deploy React App to GitHub Pages +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Github Page Deploy Workflow on: push: - branches: - - main # Trigger deployment when changes are pushed to the main branch + branches: [main] jobs: - build-and-deploy: + deploy: runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 with: - node-version: '18' - - - name: Install dependencies - run: npm install - - - name: Build React app - run: npm run build - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + node-version: "12.x" + - run: npm ci + - run: npm run build + - name: Deploy + uses: crazy-max/ghaction-github-pages@v1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build + target_branch: gh-pages + build_dir: build + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3e83d6a539a07f8dc53650cc5416089dc4f5d05e Mon Sep 17 00:00:00 2001 From: Ajay Dhangar <99037494+Ajay-Dhangar@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:41:06 +0530 Subject: [PATCH 3/3] Rename deploy.yml to deploy.yml --- .github/{workflows => workflows}/deploy.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => workflows}/deploy.yml (100%) diff --git a/.github/workflows /deploy.yml b/.github/workflows/deploy.yml similarity index 100% rename from .github/workflows /deploy.yml rename to .github/workflows/deploy.yml