Skip to content

Commit f7898b7

Browse files
Added: Chore workflow
1 parent 6804fe8 commit f7898b7

File tree

2 files changed

+70
-1
lines changed

2 files changed

+70
-1
lines changed

.github/workflows/chore.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ on:
2020
jobs:
2121
release_workflow:
2222
runs-on: ubuntu-latest
23-
23+
if: >
24+
(github.event_name == 'workflow_dispatch') ||
25+
(github.event.pull_request.merged == true &&
26+
startsWith(github.event.pull_request.head.ref, 'release/'))
2427
steps:
2528
- name: Gitflow action
2629
id: gitflow-action

0 commit comments

Comments
 (0)