diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..92f65d1 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,76 @@ +name: Deploy Documentation + +on: + push: + branches: [ main ] + paths: + - 'docs/**' + - 'mkdocs.yml' + - '.github/workflows/docs.yml' + pull_request: + branches: [ main ] + paths: + - 'docs/**' + - 'mkdocs.yml' + - '.github/workflows/docs.yml' + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + key: mkdocs-material-${{ hashFiles('requirements.txt') }} + path: ~/.cache/pip + restore-keys: | + mkdocs-material- + + - name: Install dependencies + run: | + pip install mkdocs-material + pip install mkdocs-minify-plugin + + - name: Setup Pages + id: pages + uses: actions/configure-pages@v4 + + - name: Build documentation + run: | + mkdocs build --clean + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: site + + deploy: + if: github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/mkdocs-material-gh-pages.yml b/.github/workflows/mkdocs-material-gh-pages.yml deleted file mode 100644 index b6ceb79..0000000 --- a/.github/workflows/mkdocs-material-gh-pages.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: deploy-mkdocs -on: - workflow_dispatch: - push: - branches: - - main - paths: - - docs/** - - mkdocs.yml - - requirements.txt -permissions: - contents: read - pages: write - id-token: write -concurrency: - group: "pages" - cancel-in-progress: false -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - name: Install dependencies - run: pip install -r requirements.txt - - name: Build MkDocs site - run: mkdocs build - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: './site' - - 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 \ No newline at end of file diff --git a/LayeredCraft.Cdk.Constructs.sln b/LayeredCraft.Cdk.Constructs.sln index e7fd7d8..de0330a 100644 --- a/LayeredCraft.Cdk.Constructs.sln +++ b/LayeredCraft.Cdk.Constructs.sln @@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "git", "git", "{32F31203-71F .github\dependabot.yml = .github\dependabot.yml .github\workflows\build.yaml = .github\workflows\build.yaml .github\workflows\pr-build.yaml = .github\workflows\pr-build.yaml - .github\workflows\mkdocs-material-gh-pages.yml = .github\workflows\mkdocs-material-gh-pages.yml + .github\workflows\docs.yml = .github\workflows\docs.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{B4C8E2F1-3A2D-4B8F-9C7E-1F5A8D9E2B3C}"