Skip to content

Commit

Permalink
Merge pull request #31 from thenoursehorse/add-cd
Browse files Browse the repository at this point in the history
feat: add dynamic versioning
  • Loading branch information
thenoursehorse authored Oct 26, 2023
2 parents 5f562df + a4c77dc commit 49dfd3b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/docs.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
Expand All @@ -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: |
Expand All @@ -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
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
Expand Down Expand Up @@ -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
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

0 comments on commit 49dfd3b

Please sign in to comment.