Files
calibre-web/.gitea/workflows/00_check-release.yaml
Eric Coissac 9c5db567f3
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m6s
Check Calibre-web version / check-version (push) Successful in 25s
Actualiser .gitea/workflows/00_check-release.yaml
2025-04-14 16:56:03 +02:00

50 lines
1.9 KiB
YAML

name: Check Calibre-web version
on:
schedule:
- cron: "15 */6 * * *"
push:
branches:
- main # Changez cela si votre branche principale a un autre nom
jobs:
check-version:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Retrieve latest Calibre-web version
run: |
mkdir -p /tmp
curl -s https://api.github.com/repos/janeczku/calibre-web/releases/latest \
| jq -r .tag_name > /tmp/calibre_web_latest.txt
diff calibre_web_latest.txt /tmp/calibre_web_latest.txt \
|| mv /tmp/calibre_web_latest.txt calibre_web_latest.txt
shell: bash
- name: Check if version changed
uses: stefanzweifel/git-auto-commit-action@v5
id: auto-commit-action
commit_user_name: My Gitea Actions Bot
commit_user_email: eric@petite-maison-orange.fr
commit_author: Gitea Action <servers@coissac.eu> # defaults to "username <numeric_id+username@users.noreply.github.com>", where "numeric_id" and "username" belong to the author of the commit that triggered the run
commit_message: New calibre-web version avalaible
- name: Send new version to Haoma
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: |
curl -fsS -m 10 --retry 5 \
--data-raw "New version avalaible $(cat calibre_web_latest.txt)" \
'https://haoma.petite-maison-orange.fr/ping/933b9d63-37e1-42a7-9681-241af9c582f1'
shell: bash
- name: Send no version to Haoma
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: |
curl -fsS -m 10 --retry 5 \
--data-raw "No version avalaible stay on $(cat calibre_web_latest.txt)" \
'https://haoma.petite-maison-orange.fr/ping/8b0402af-7718-4c86-a3f0-02d798cc6fa3'
shell: bash