From c8e66f77f523dbd84e82a6b9b78c1f3695286ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20B=C3=B6hm?= Date: Tue, 6 Aug 2024 23:28:47 +0200 Subject: [PATCH] build: Switch docs workflow to official GitHub actions --- .github/workflows/docs.yml | 35 +++++++++++++++-------------------- .github/workflows/publish.yml | 8 +++----- .github/workflows/test.yml | 2 -- 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 85b1d84..21c3265 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,23 +1,18 @@ name: Documentation - on: push: branches: [main] - paths: - - "docs/**" - - "aiomqtt/**" - - README.md - - .github/workflows/docs.yml pull_request: - paths: - - "docs/**" - - "aiomqtt/**" - - README.md - - .github/workflows/docs.yml - jobs: docs: runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + contents: read + pages: write + id-token: write defaults: run: shell: bash @@ -43,12 +38,12 @@ jobs: run: scripts/setup - name: Build documentation run: scripts/docs - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/main' + - name: Upload artifact + # if: github.ref == 'refs/heads/main' + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/_build - publish_branch: documentation - user_name: "github-actions[bot]" - user_email: "github-actions[bot]@users.noreply.github.com" + path: docs/_build + - name: Deploy to GitHub Pages + # if: github.ref == 'refs/heads/main' + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 30cce2a..0aa60ef 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,20 +1,18 @@ name: Publish - on: release: types: [published] - jobs: publish: runs-on: ubuntu-latest - defaults: - run: - shell: bash environment: name: pypi url: https://pypi.org/project/aiomqtt permissions: id-token: write + defaults: + run: + shell: bash steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa4d79c..0a667cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,10 +1,8 @@ name: Tests - on: push: branches: [main] pull_request: - jobs: test: strategy: