Check Caddy Releases #2016
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: Check Caddy Releases | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: # Allows manual triggering | |
permissions: | |
contents: write | |
jobs: | |
check-caddy-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: pip install requests | |
- name: Check and compare Caddy release | |
id: check_release | |
run: python scripts/check_caddy_release.py | |
- name: Update version file | |
if: env.IS_NEW_RELEASE == 'true' | |
run: | | |
echo "{\"version\": \"${{ env.LATEST_VERSION }}\"}" > version.json | |
git config --global user.name "vkartk" | |
git config --global user.email "53650724+vkartk@users.noreply.github.com" | |
git add version.json | |
git commit -m "Update version to ${{ env.LATEST_VERSION }}" | |
git push | |
- name: Trigger Build Workflow | |
if: env.IS_NEW_RELEASE == 'true' | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.repos.createDispatchEvent({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
event_type: 'caddy-release', | |
client_payload: { | |
latest_version: '${{ env.LATEST_VERSION }}' | |
} | |
}) |