From 2be9d666425a509472f621cf44685e39b7f410cb Mon Sep 17 00:00:00 2001 From: Allison Thackston Date: Mon, 19 Jun 2023 17:17:10 -0700 Subject: [PATCH] Test action deploy --- .github/workflows/publish_docs.yml | 54 +++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index 9a24e3d2..49d670f1 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -1,4 +1,4 @@ -name: Documentation +name: Publish docs on: push: @@ -8,8 +8,19 @@ on: repository_dispatch: types: [publish-docs] +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + jobs: - publish-docs: + build: runs-on: ubuntu-latest steps: - name: Checkout @@ -17,8 +28,41 @@ jobs: - name: Setup config uses: athackst/athackst.mkdocs@main - name: Build and push docs to gh-pages + id: mkdocs uses: athackst/mkdocs-simple-plugin@main - - name: Htmlproofer - uses: athackst/htmlproofer-action@main with: - directory: site + push: false + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: 'github-pages' + path: ${{ steps.mkdocs.outputs.artifact }} + retention-days: 1 + + test: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: github-pages + - name: Extract + run: | + mkdir _site + tar --directory _site -xvf "artifact.tar" + tree + - name: Test with htmlproofer + uses: athackst/htmlproofer-action@main + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: [build,test] + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2