From 713dd6f782a72fe5f30fd9a5a194cc1da278aae5 Mon Sep 17 00:00:00 2001 From: Alexander Reynolds Date: Fri, 13 Sep 2024 11:32:05 -0400 Subject: [PATCH] Create deploy-docs.yml Used a template for mdBook, but edited for mkdocs (the mkdocs actions I found all seemed pretty bad---poor ways to specify dependencies, etc) --- .github/workflows/deploy-docs.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/deploy-docs.yml diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 00000000..e2ad0aa1 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,51 @@ +name: Deploy mkdocs site to Pages + +on: + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - uses: snok/install-poetry@v1 + - uses: extractions/setup-just@v2 + - name: Install dependencies + run: | + just install + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Build with mkdocs + run: mkdocs build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./site + + # Deployment job + deploy: + 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