Update Flakkari Logo #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Flakkari Logo | |
on: | |
schedule: | |
- cron: '0 0 1 10 *' | |
- cron: '0 0 1 11 *' | |
- cron: '0 0 1 12 *' | |
- cron: '0 0 1 1 *' | |
env: | |
GH_PAT: ${{ secrets.GITHUB_TOKEN }} | |
GH_BOT_ACC_EMAIL: github-actions[bot]@users.noreply.github.com | |
GH_BOT_ACC_NAME: github-actions[bot] | |
jobs: | |
update_logo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Git | |
run: | | |
git config --local user.email $GH_BOT_ACC_EMAIL | |
git config --local user.name $GH_BOT_ACC_NAME | |
- name: Update README.md logo | |
run: | | |
current_month=$(date +'%m') | |
if [ "$current_month" -eq "10" ]; then | |
echo "period_event=halloween" >> $GITHUB_ENV | |
sed -i 's|<img src="Images/Logo_1-200x200.png"|<img src="Images/Logo-Halloween-200x200.png"|g' README.md | |
elif [ "$current_month" -eq "12" ]; then | |
echo "period_event=christmas" >> $GITHUB_ENV | |
sed -i 's|<img src="Images/Logo_1-200x200.png"|<img src="Images/Logo-Christmas-200x200.png"|g' README.md | |
else | |
echo "period_event=normal" >> $GITHUB_ENV | |
sed -i 's|<img src="Images/Logo_1-200x200.png"|<img src="Images/Logo_2-200x200.png"|g' README.md | |
fi | |
- name: Update Doxyfile.cfg logo | |
run: | | |
if [ "$current_month" -eq "10" ]; then | |
sed -i 's|PROJECT_LOGO = docs/Images/Flakkari-200x200.png|PROJECT_LOGO = docs/Images/Flakkari-Halloween-200x200.png|g' Doxyfile.cfg | |
elif [ "$current_month" -eq "12" ]; then | |
sed -i 's|PROJECT_LOGO = docs/Images/Flakkari-200x200.png|PROJECT_LOGO = docs/Images/Flakkari-Christmas-200x200.png|g' Doxyfile.cfg | |
else | |
sed -i 's|PROJECT_LOGO = docs/Images/Flakkari-200x200.png|PROJECT_LOGO = docs/Images/Flakkari-2-200x200.png|g' Doxyfile.cfg | |
- name: Commit and Push Changes | |
run: | | |
git add . | |
git commit -m "chore: update the Engine-3D logo for ${{ env.period_event }}" || true | |
git push || true | |
- name: Call the Flakkari deploy_doxygen_page workflow | |
run: | | |
curl -X POST \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.everest-preview+json" \ | |
https://api.github.com/repos/${{ github.repository }}/dispatches \ | |
-d '{"event_type":"update_logo_event"}' |