This commit is contained in:
Eshan Roy
2024-12-03 19:29:02 +05:30
parent b59f4a1213
commit 0be41b4eb6

View File

@@ -1,31 +1,47 @@
name: Deploy React App to GitHub Pages name: Deploy to GitHub Pages
on: on:
push: push:
branches: branches:
- master - master
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
permissions:
contents: write
jobs: jobs:
deploy: deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - uses: actions/checkout@v4
uses: actions/checkout@v3 with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Set up Node.js - name: Install dependencies
uses: actions/setup-node@v3 run: npm ci
with: - name: Install font-awesome
node-version: 20 run: npm install --save font-awesome
- name: Build documents
run: npm run build
- name: Install dependencies # Popular action to deploy to GitHub Pages:
run: npm install # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
- name: Build project uses: peaceiris/actions-gh-pages@v3
run: npm run build with:
github_token: ${{ secrets.PRO_TOKEN }}
- name: Deploy to GitHub Pages # Build output to publish to the `gh-pages` branch:
uses: peaceiris/actions-gh-pages@v3 publish_dir: ./build
with: # The following lines assign commit authorship to the official
github_token: ${{ secrets.PRO_TOKEN }} # GH-Actions bot for deploys to `gh-pages` branch:
publish_dir: ./build # https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com