From b05a2ba57649b25421329de3b3e043b9af3a3a75 Mon Sep 17 00:00:00 2001 From: Mihails Delmans Date: Fri, 31 Jan 2025 16:21:53 +0000 Subject: [PATCH] Fix chore workflow --- .github/workflows/chore.yml | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/chore.yml diff --git a/.github/workflows/chore.yml b/.github/workflows/chore.yml new file mode 100644 index 0000000..5afa6bd --- /dev/null +++ b/.github/workflows/chore.yml @@ -0,0 +1,66 @@ +name: Chore & Docs Workflow + +on: + pull_request: + types: + - closed + branches: + - main + +jobs: + merge-to-develop: + name: Merge to develop + if: > + (startsWith(github.event.pull_request.head.ref, 'chore/') || + startsWith(github.event.pull_request.head.ref, 'docs/')) + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Merge Source Branch into Develop + run: | + git config --global user.name "bot" + git config --global user.email "bot@colorifix.com" + git fetch + git checkout develop + git merge --no-ff origin/${{ github.event.pull_request.head.ref }} -m "Merge ${{ github.event.pull_request.head.ref }} into develop" + git push origin develop + + - name: Build docs + if: startsWith(github.event.pull_request.head.ref, 'docs/') + run: foo + + publish-docs: + name: Publish Documentation + runs-on: ubuntu-latest + if: startsWith(github.event.pull_request.head.ref, 'docs/') + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install Poetry + uses: abatilo/actions-poetry@v2 + with: + poetry-version: 'latest' + + - name: Install dev dependencies + run: poetry install --only dev --no-root + + - name: Build docs + run: poetry run mkdocs build + + - name: Upload docs as artifacts + uses: actions/upload-pages-artifact@v3 + with: + path: site + + - name: Deploy pages + uses: actions/deploy-pages@v4