Skip to content

Commit 078f749

Browse files
committed
feat: add workflow to update logo based on seasonal events and trigger Doxygen page deployment
1 parent 3f0939c commit 078f749

File tree

2 files changed

+66
-2
lines changed

2 files changed

+66
-2
lines changed

.github/workflows/deploy_doxygen_page.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ on:
33
pull_request:
44
types: [closed]
55
branches: [master, main]
6-
milestone:
7-
types: [closed]
6+
repository_dispatch:
7+
types:
8+
- update_logo_event
89

910
jobs:
1011
generate:

.github/workflows/update_logo.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Update Flakkari Logo
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 1 10 *'
6+
- cron: '0 0 1 11 *'
7+
- cron: '0 0 1 12 *'
8+
- cron: '0 0 1 1 *'
9+
10+
env:
11+
GH_PAT: ${{ secrets.GITHUB_TOKEN }}
12+
GH_BOT_ACC_EMAIL: github-actions[bot]@users.noreply.github.com
13+
GH_BOT_ACC_NAME: github-actions[bot]
14+
15+
jobs:
16+
update_logo:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Git
24+
run: |
25+
git config --local user.email $GH_BOT_ACC_EMAIL
26+
git config --local user.name $GH_BOT_ACC_NAME
27+
28+
- name: Update README.md logo
29+
run: |
30+
current_month=$(date +'%m')
31+
if [ "$current_month" -eq "10" ]; then
32+
echo "period_event=halloween" >> $GITHUB_ENV
33+
sed -i 's|<img src="Images/Logo_1-200x200.png"|<img src="Images/Logo-Halloween-200x200.png"|g' README.md
34+
elif [ "$current_month" -eq "12" ]; then
35+
echo "period_event=christmas" >> $GITHUB_ENV
36+
sed -i 's|<img src="Images/Logo_1-200x200.png"|<img src="Images/Logo-Christmas-200x200.png"|g' README.md
37+
else
38+
echo "period_event=normal" >> $GITHUB_ENV
39+
sed -i 's|<img src="Images/Logo_1-200x200.png"|<img src="Images/Logo_2-200x200.png"|g' README.md
40+
fi
41+
42+
- name: Update Doxyfile.cfg logo
43+
run: |
44+
if [ "$current_month" -eq "10" ]; then
45+
sed -i 's|PROJECT_LOGO = docs/Images/Flakkari-200x200.png|PROJECT_LOGO = docs/Images/Flakkari-Halloween-200x200.png|g' Doxyfile.cfg
46+
elif [ "$current_month" -eq "12" ]; then
47+
sed -i 's|PROJECT_LOGO = docs/Images/Flakkari-200x200.png|PROJECT_LOGO = docs/Images/Flakkari-Christmas-200x200.png|g' Doxyfile.cfg
48+
else
49+
sed -i 's|PROJECT_LOGO = docs/Images/Flakkari-200x200.png|PROJECT_LOGO = docs/Images/Flakkari-2-200x200.png|g' Doxyfile.cfg
50+
51+
- name: Commit and Push Changes
52+
run: |
53+
git add .
54+
git commit -m "chore: update the Engine-3D logo for ${{ env.period_event }}" || true
55+
git push || true
56+
57+
- name: Call the Flakkari deploy_doxygen_page workflow
58+
run: |
59+
curl -X POST \
60+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
61+
-H "Accept: application/vnd.github.everest-preview+json" \
62+
https://api.github.com/repos/${{ github.repository }}/dispatches \
63+
-d '{"event_type":"update_logo_event"}'

0 commit comments

Comments
 (0)