diff --git a/.github/workflows/publish-gh-pages-backport-2.1.yml b/.github/workflows/publish-gh-pages-backport-2.1.yml deleted file mode 100644 index f0cfc15..0000000 --- a/.github/workflows/publish-gh-pages-backport-2.1.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This workflow can be used to backport a release from a tag to the gh-pages branch -# This is useful when you want to backport a release to the gh-pages branch -# It is hardcoded for versions v2.1.0 -# @BASE_REF: the tag you want to backport from -# @VERSIONS: the versions you want to backport to - -name: Publish Backport GitHub Pages - -on: - workflow_dispatch: - -env: - BASE_REF: v2.1.0-with-backported-fixes - VERSIONS: v2.1.0 -jobs: - publish-to-gh-pages: - name: Publish to GitHub Pages - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - with: - ref: ${{ env.BASE_REF }} - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - - name: Install npm dependencies - run: yarn --immutable - - name: Run build script - run: | - yarn build:prod - - - name: Checkout gh-pages - uses: actions/checkout@v3 - with: - ref: 'gh-pages' - path: 'gh-pages' - - - name: prep for pr - run: | - IFS=',' read -ra VERSION_ARRAY <<< ${{ env.VERSIONS }} - for version in "${VERSION_ARRAY[@]}"; do - rm -rf "gh-pages/${version}"/* - cp -r dist/* "gh-pages/${version}/" - done - - - name: Commit files - run: | - cd gh-pages - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git status - git remote --verbose - git branch -D gh-pages-backport-2.1 || true - git checkout -b gh-pages-backport-2.1 - git add . - git commit -m "Update gh-pages" - git push origin gh-pages-backport-2.1 -f - echo "Pushed build changes to gh-pages-backport-2.1" - echo "REMEMBER TO CREATE A PR FROM gh-pages-backport-2.1 TO gh-pages" diff --git a/.github/workflows/publish-gh-pages-backport-pre-2.1.yml b/.github/workflows/publish-gh-pages-backport-pre-2.1.yml deleted file mode 100644 index c12bde6..0000000 --- a/.github/workflows/publish-gh-pages-backport-pre-2.1.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Publish Backport GitHub Pages -# This workflow can be used to backport a release from a tag to the gh-pages branch -# This is useful when you want to backport a release to the gh-pages branch -# It is hardcoded for versions <= v2.0.1 as they are incomaptible with the v2.1.0 gh-pages -# @BASE_REF: the tag you want to backport from -# @VERSIONS: the versions you want to backport to - -on: - workflow_dispatch: - -env: - BASE_REF: v2.0.1-with-backported-fixes - VERSIONS: v1.0.0,v1.1.0,v1.2.1,v1.2.2,v2.0.0,v2.0.1 -jobs: - publish-to-gh-pages: - name: Publish to GitHub Pages - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout the repository - uses: actions/checkout@v3 - with: - ref: ${{ env.BASE_REF }} - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: 'yarn' - - name: Install npm dependencies - run: yarn --immutable - - name: Run build script - run: | - yarn build:prod - - - name: Checkout gh-pages - uses: actions/checkout@v3 - with: - ref: 'gh-pages' - path: 'gh-pages' - - - name: prep for pr - run: | - IFS=',' read -ra VERSION_ARRAY <<< ${{ env.VERSIONS }} - for version in "${VERSION_ARRAY[@]}"; do - rm -rf "gh-pages/${version}"/* - cp -r dist/* "gh-pages/${version}/" - done - - - name: Commit files - run: | - cd gh-pages - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git status - git remote --verbose - git branch -D gh-pages-backport-2.0.1 || true - git checkout -b gh-pages-backport-2.0.1 - git add . - git commit -m "Update gh-pages" - git push origin gh-pages-backport-2.0.1 -f - echo "Pushed build changes to gh-pages-backport-2.0.1" - echo "REMEMBER TO CREATE A PR FROM gh-pages-backport-2.0.1 TO gh-pages" diff --git a/.github/workflows/publish-gh-pages.yml b/.github/workflows/publish-gh-pages.yml index 68bc253..b658b19 100644 --- a/.github/workflows/publish-gh-pages.yml +++ b/.github/workflows/publish-gh-pages.yml @@ -11,8 +11,7 @@ jobs: publish-to-gh-pages: name: Publish to GitHub Pages runs-on: ubuntu-latest - permissions: - contents: write + environment: github-pages steps: - name: Ensure `destination_dir` is not empty if: ${{ inputs.destination_dir == '' }} @@ -31,6 +30,6 @@ jobs: - name: Deploy to `${{ inputs.destination_dir }}` directory of `gh-pages` branch uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + personal_token: ${{ secrets.DEPLOY_TOKEN }} publish_dir: ./dist destination_dir: ${{ inputs.destination_dir }}