-
Notifications
You must be signed in to change notification settings - Fork 1
97 lines (75 loc) · 2.62 KB
/
gitgraph.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: generate git graph
# Controls when the workflow will run
on:
# Triggers the workflow on push events and only for the main branch
push:
branches: [main]
pull_request:
branches-ignore: [main]
schedule:
- cron: "5 7 * * */2" # every two days at 7:05am UTC
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
repository_dispatch: # run workflow on api request
# prevent concurrent jobs
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: clone remote repo
run: git clone https://codeberg.org/Starfish/TinyWeatherForecastGermany.git TinyWeatherForecastGermany
- name: clone this repo
run: git clone https://github.com/${{ github.repository }}.git "git-graph"
- name: update apt packages
run: timeout 120s sudo apt update || true
- name: upgrade apt packages
run: timeout 120s sudo apt upgrade -y || true
- name: Setup Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: install virtualenv
run: pip install virtualenv
- name: init virtualenv
run: virtualenv venv
- name: activate virtualenv
run: source venv/bin/activate
- name: upgrade pip
run: python -m pip install --upgrade pip
- name: install graphviz
run: sudo apt install -y graphviz
- name: list directory contents
run: ls -lisha
- name: install pip dependencies
run: pip install -r git-graph/requirements.txt
- name: generate git graph using Python and graphviz
run: python git-graph/git_log2graphviz.py
- name: list directory contents
run: ls -lisha
- name: archive generated svg
uses: actions/upload-artifact@v3
with:
name: generated-svg
path: |
*.svg
*.dot
- name: copy artifacts to git repo directory
run: |
cp *.svg git-graph/ || true
cp *.dot git-graph/ || true
- name: git commit and push
run: |
cd git-graph
git config --local user.name eUgEntOptIc44
git config --local user.email [email protected]
git checkout --orphan pages
git reset
git add *.svg
git add *.dot || true
git add README.md || true
git commit -m "update git graph"
git remote add github-pages "https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
git push -u -f github-pages