From eb6005439d71edd4aa980f0c79db98508ef53480 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 15 Dec 2023 23:48:26 -0800 Subject: add deployment to gh-pages for build script --- .github/workflows/deploy.yml | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 607f08b..bc055fa 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,8 +1,18 @@ name: Build documentation + on: + # If specified, the workflow will be triggered automatically once you push to the `main` branch. + # Replace `main` with your branch’s name push: branches: ["main"] + # Specify to run a workflow manually from the Actions tab on GitHub workflow_dispatch: + +# Gives the workflow permissions to clone the repo and create a page deployment +permissions: + id-token: write + pages: write + env: # Name of module and id separated by a slash INSTANCE: Writerside/hi @@ -17,6 +27,7 @@ env: jobs: build: runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v3 @@ -45,20 +56,30 @@ jobs: path: artifacts/${{ env.ALGOLIA_ARTIFACT }} retention-days: 7 - # Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors - test: - # Requires build job results - needs: build + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + # Requires the build job results + needs: test runs-on: ubuntu-latest - steps: - - name: Download artifacts - uses: actions/download-artifact@v1 + - name: Download artifact + uses: actions/download-artifact@v3 with: name: docs - path: artifacts - - name: Test documentation - uses: JetBrains/writerside-checker-action@v1 + - name: Unzip artifact + run: unzip -O UTF-8 -qq ${{ env.ARTIFACT }} -d dir + + - name: Setup Pages + uses: actions/configure-pages@v2 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - instance: ${{ env.INSTANCE }} \ No newline at end of file + path: dir + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file -- cgit v1.2.3