From 20578afea588dc4f664b8ba0641209c0cc067f54 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Fri, 30 Dec 2022 15:11:35 -0500 Subject: [PATCH] [O] Optimize deploy to pages action --- .github/workflows/generator.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/generator.yml b/.github/workflows/generator.yml index 03771a04..49a4a00f 100644 --- a/.github/workflows/generator.yml +++ b/.github/workflows/generator.yml @@ -10,6 +10,12 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + jobs: build: runs-on: ubuntu-latest @@ -38,15 +44,8 @@ jobs: - name: Build run: yarn build - - name: Deploy - run: | - git config --global user.name "$(git show -s --format='%an' HEAD)" - git config --global user.email "$(git show -s --format='%ae' HEAD)" - - cd dist - git init - git add . - git commit -m "Build on $(date '+%Y-%m-%d %H:%M:%S')" - git branch -m gh-pages - git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git push -f origin gh-pages + - name: Deploy to github pages + uses: JamesIves/github-pages-deploy-action@4.4.1 + with: + branch: gh-pages + folder: dist