From 3c3d7f7f9146697714d15c6190e8a20c48cf730b Mon Sep 17 00:00:00 2001 From: Aashish Vivekanand Date: Mon, 30 Oct 2023 20:56:33 +0800 Subject: [PATCH] Updated CICD for deploy --- .github/workflows/deploy.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5ce55d0..f55ce09 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,10 +23,19 @@ jobs: - 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/github-pages-deploy-action@4.1.5 with: branch: gh-pages - folder: build - clean: true - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} \ No newline at end of file + folder: build + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}