-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (47 loc) · 1.55 KB
/
build-plantuml.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Generate Files
on:
push:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest # You can choose a different runner OS if needed
steps:
- uses: actions/checkout@v4 # Checkout your repository code
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Run script
run: |
cd models/schemas/
bash ./generate_puml.sh
cd ../examples
bash ./generate_puml.sh
# Add any additional commands your script might need (e.g., install dependencies)
- name: Generate SVG
run: |
cd models/
python3 generate_svg.py ${{ steps.extract_branch.outputs.branch }}
- name: Generate Docs
run: |
cd docs
python3 generate_docs.py
- name: Check for changes
id: git-check
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "::set-output name=changes::true"
else
echo "::set-output name=changes::false"
fi
- name: Commit changes
if: steps.git-check.outputs.changes == 'true'
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add .
git commit -m "Auto-generated files"
git push origin HEAD:${{ steps.extract_branch.outputs.branch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}