diff --git a/.github/workflows/docs.yml b/.github/workflows/cd.yml similarity index 65% rename from .github/workflows/docs.yml rename to .github/workflows/cd.yml index 25a60d5..02bdfe2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/cd.yml @@ -1,28 +1,35 @@ -name: Docs +name: CD on: - workflow_dispatch: - push: + pull_request: + types: + - closed branches: - main -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - jobs: build: + if: github.event.pull_request.merged == true runs-on: ubuntu-22.04 + permissions: + contents: write - name: Build docs steps: - uses: actions/checkout@v4 + + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} - name: Setup Python 3.10 and TRIQS uses: ./.github/actions/setup-triqs @@ -32,7 +39,7 @@ jobs: - name: Install risb and docs dependencies run: | source $TRIQS_INSTALL/share/triqs/triqsvars.sh - python -m pip install -e .[docs] + python -m pip install .[docs] - name: Build docs run: | @@ -46,10 +53,13 @@ jobs: name: docs-build path: docs/_build - deploy: + deploy-docs: needs: [build] - runs-on: ubuntu-latest + permissions: + contents: read + pages: write + id-token: write environment: name: github-pages diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 80% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml index ba23f04..a3907a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ -name: Build +name: CI on: + workflow_dispatch: pull_request: push: branches: @@ -41,9 +42,15 @@ jobs: - name: Install risb run: | source $TRIQS_INSTALL/share/triqs/triqsvars.sh - python -m pip install -e .[test] + python -m pip install -e .[test,docs] - name: Test risb run: | source $TRIQS_INSTALL/share/triqs/triqsvars.sh - python -m pytest \ No newline at end of file + python -m pytest + + - name: Test docs + run: | + source $TRIQS_INSTALL/share/triqs/triqsvars.sh + sphinx-apidoc -o docs/api --module-first --no-toc --force --separate src/risb + sphinx-build -b html -n -T docs docs/_build \ No newline at end of file