From 915fe6e2751c058a59705066baa82f826f9e6bec Mon Sep 17 00:00:00 2001 From: Nick Satterly Date: Sun, 19 Mar 2023 17:59:36 +0100 Subject: [PATCH] Update github action workflows --- .github/workflows/deploy.yml | 34 ----------- .github/workflows/release.yml | 69 +++++++++++++++++++++++ .github/workflows/{test.yml => tests.yml} | 12 ++-- 3 files changed, 76 insertions(+), 39 deletions(-) delete mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/release.yml rename .github/workflows/{test.yml => tests.yml} (86%) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index c3c57692..00000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Build and Deploy - -on: - push: - tags: - - 'v*' - -env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: install - run: - pip install -r requirements.txt - - name: build - id: build - run: - sphinx-build -b html -d _build/doctrees . _build/html - - - name: Deploy - id: deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: _build/html - - - uses: act10ns/slack@v1 - with: - status: ${{ job.status }} - steps: ${{ toJson(steps) }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..3ab7e136 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,69 @@ +name: Release + +on: + push: + tags: [ 'v*' ] + +env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install dependencies + id: install-deps + run: + python3 -m pip install --upgrade pip + pip install -r requirements.txt + # - name: nitpick + # id: nitpick + # run: + # sphinx-build -b html -n . _build/html + # - name: linkcheck + # id: linkcheck + # run: + # sphinx-build -b linkcheck . _build/linkcheck + # - name: spelling + # id: spelling + # run: + # sphinx-build -b spelling . _build/spelling + + release: + name: Publish + needs: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install dependencies + id: install-deps + run: + python3 -m pip install --upgrade pip + pip install -r requirements.txt + - name: Build HTML + id: build + run: + sphinx-build -b html -d _build/doctrees . _build/html + + - name: Publish to GitHub Pages + id: publish + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _build/html + + - uses: act10ns/slack@v1 + with: + status: ${{ job.status }} + steps: ${{ toJson(steps) }} diff --git a/.github/workflows/test.yml b/.github/workflows/tests.yml similarity index 86% rename from .github/workflows/test.yml rename to .github/workflows/tests.yml index a92ddc46..8d3e1cf9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/tests.yml @@ -1,9 +1,9 @@ -name: Test +name: Tests on: push: - # tags: - # - 'v*' + pull_request: + branches: [ master ] env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} @@ -11,8 +11,9 @@ env: jobs: test: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install run: pip install -r requirements.txt @@ -31,8 +32,9 @@ jobs: build: runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: install run: pip install -r requirements.txt