|
| 1 | +name: Chore & Docs Workflow |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: |
| 6 | + - closed |
| 7 | + branches: |
| 8 | + - main |
| 9 | + |
| 10 | +jobs: |
| 11 | + merge-to-develop: |
| 12 | + name: Merge to develop |
| 13 | + if: > |
| 14 | + (startsWith(github.event.pull_request.head.ref, 'chore/') || |
| 15 | + startsWith(github.event.pull_request.head.ref, 'docs/')) |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout Repository |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Merge Source Branch into Develop |
| 23 | + run: | |
| 24 | + git config --global user.name "bot" |
| 25 | + git config --global user.email "[email protected]" |
| 26 | + git fetch origin develop |
| 27 | + git checkout develop |
| 28 | + git merge --no-ff origin/${{ github.event.pull_request.head.ref }} -m "Merge ${{ github.event.pull_request.head.ref }} into develop" |
| 29 | + git push origin develop |
| 30 | +
|
| 31 | + - name: Build docs |
| 32 | + if: startsWith(github.event.pull_request.head.ref, 'docs/') |
| 33 | + run: foo |
| 34 | + |
| 35 | + publish-docs: |
| 36 | + name: Publish Documentation |
| 37 | + runs-on: ubuntu-latest |
| 38 | + if: startsWith(github.event.pull_request.head.ref, 'docs/') |
| 39 | + |
| 40 | + steps: |
| 41 | + - name: Checkout Repository |
| 42 | + uses: actions/checkout@v4 |
| 43 | + |
| 44 | + - name: Install Python |
| 45 | + uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version: '3.11' |
| 48 | + |
| 49 | + - name: Install Poetry |
| 50 | + uses: abatilo/actions-poetry@v2 |
| 51 | + with: |
| 52 | + poetry-version: 'latest' |
| 53 | + |
| 54 | + - name: Install dev dependencies |
| 55 | + run: poetry install --only dev --no-root |
| 56 | + |
| 57 | + - name: Build docs |
| 58 | + run: poetry run mkdocs build |
| 59 | + |
| 60 | + - name: Upload docs as artifacts |
| 61 | + uses: actions/upload-pages-artifact@v3 |
| 62 | + with: |
| 63 | + path: site |
| 64 | + |
| 65 | + - name: Deploy pages |
| 66 | + uses: actions/deploy-pages@v4 |
0 commit comments