diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57620b04..eb8f5397 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,18 @@ -name: Build and Deploy -on: - push: - branches: - - master +name: Build site +on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout master - uses: actions/checkout@v2.4.0 - - name: Deploy MkDocs - uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Install python + uses: actions/setup-python@v5 + with: + python-version: 3.x + - name: Install deps + run: pip install -U -r requirements.txt + - name: Build + run: mkdocs build --strict \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..c8bddeeb --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,39 @@ +name: Deploy Website +on: + push: + branches: + - master + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: pip install -U -r requirements.txt + - run: mkdocs build --strict + - uses: actions/upload-pages-artifact@v3 + with: + path: 'site' + - id: deployment + if: github.ref_name == 'master' + uses: actions/deploy-pages@v4 \ No newline at end of file