diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..8bf89f4 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,36 @@ +name: Docs + +on: + workflow_dispatch: + branches: + - main + workflow_call: + +permissions: + contents: write + +jobs: + docs: + name: "Docs" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + cache: "pip" + - name: Install package + run: pip install -e . + - name: Install Sphinx dependencies + working-directory: docs + run: pip install -r requirements.txt + - name: Sphinx build + working-directory: docs + run: sphinx-build . _build + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/_build/ + force_orphan: true \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8bb23c2..17ac8c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,12 @@ defaults: permissions: read-all jobs: - build-and-publish: + test: + uses: ./.github/workflows/test.yml + secrets: inherit + publish: + needs: test + name: "Publish" runs-on: ubuntu-latest environment: name: pypi @@ -99,9 +104,15 @@ jobs: rm -rf dist rm -rf $CHANGELOG_PATH docker: - needs: build-and-publish + needs: [ test, publish ] permissions: packages: write contents: read uses: ./.github/workflows/docker.yml + secrets: inherit + docs: + uses: ./.github/workflows/docs.yml + needs: [ test, publish ] + permissions: + contents: write secrets: inherit \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3781d25..2ad4ff7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,7 @@ on: pull_request: branches: - master + workflow_call: defaults: run: shell: bash @@ -14,6 +15,7 @@ permissions: read-all jobs: analyze: + name: "Analyze" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,6 +30,7 @@ jobs: - name: Run static analysis run: tox -e linters test: + name: "Test" needs: analyze runs-on: ubuntu-latest strategy: