Skip to content

Updated CICD for deploy #3

Updated CICD for deploy

Updated CICD for deploy #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- reactjs-sample
jobs:
deploy:
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.x' # Using Node 14.x
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
# Clean gh-pages branch
- name: Checkout gh-pages branch and delete all content
run: |
git fetch
git checkout gh-pages
git rm -rf *
git commit -m "Clean up gh-pages branch"
git checkout $GITHUB_REF
# Push new content to gh-pages
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}