📝 Add note and link to Docker Swarm awesome list (#142) #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Docs | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
# Required permissions | |
permissions: | |
pull-requests: read | |
# Set job outputs to values from filter step | |
outputs: | |
docs: ${{ steps.filter.outputs.docs }} | |
steps: | |
- uses: actions/checkout@v4 | |
# For pull requests it's not necessary to checkout the code but for the main branch it is | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
docs: | |
- README.md | |
- docs/** | |
- pyproject.toml | |
- mkdocs.yml | |
- .github/workflows/build-docs.yml | |
- .github/workflows/deploy-docs.yml | |
build-docs: | |
needs: | |
- changes | |
if: ${{ needs.changes.outputs.docs == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- uses: actions/cache@v4 | |
id: cache | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-v01 | |
- name: Install Poetry | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install "poetry" | |
- name: Configure poetry | |
run: python -m poetry config virtualenvs.create false | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: python -m poetry install | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-cards-${{ github.ref }} | |
path: .cache | |
- name: Verify README | |
run: diff --brief docs/index.md ./README.md | |
- name: Build Docs | |
run: python -m mkdocs build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: docs-site | |
path: ./site/** | |
# https://github.com/marketplace/actions/alls-green#why | |
docs-all-green: # This job does nothing and is only used for the branch protection | |
if: always() | |
needs: | |
- build-docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} | |
allowed-skips: build-docs |