From 32e346139b20fde8fb8bef6399291a9d23ce6ef6 Mon Sep 17 00:00:00 2001 From: lifehackerhansol Date: Wed, 24 Apr 2024 08:11:06 -0700 Subject: [PATCH] Migrate fully to GitHub Actions for Pages deployment (#173) Legacy deploy environments (including simply having something in gh-pages!) is deprecated. GitHub really wants us to use their deploy-pages system for this, so switch to it. --- .github/workflows/publish.yml | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e65b57483..1697d7123 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,15 +10,18 @@ on: workflow_dispatch: jobs: - doc-deploy: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: false submodules: recursive + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + - uses: actions/setup-node@v3 with: node-version: 20 @@ -30,9 +33,25 @@ jobs: # Build the site using VuePress run: npm run docs:build - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.4.1 + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 with: - branch: gh-pages # The branch the action should deploy to. - folder: docs/.vuepress/dist # The folder the action should deploy. - clean: true # Automatically remove deleted files from the deploy branch + path: "docs/.vuepress/dist" + + # Deployment job + deploy: + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + contents: read + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4