Update Event Server Version #762
This file contains hidden or 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 Event Server Version | |
| on: | |
| push: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Update Event Server Version | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GHCR_PAT }} | |
| - name: Update | |
| id: update | |
| run: | | |
| set -x | |
| zm_version=$(wget \ | |
| --no-check-certificate -qO - \ | |
| https://api.github.com/repos/zoneminder-containers/zoneminder-base/releases/latest \ | |
| | awk '/tag_name/{print $4;exit}' FS='[""]') | |
| es_version=$(wget \ | |
| --no-check-certificate -qO - \ | |
| https://api.github.com/repos/ZoneMinder/zmeventnotification/releases/latest \ | |
| | awk '/tag_name/{print $4;exit}' FS='[""]') | |
| export VERSION="zm_v${zm_version}-es_${es_version}" | |
| echo "::set-output name=version::${VERSION}" | |
| - name: Push tag | |
| id: tag_version | |
| run: | | |
| set -x | |
| git config user.name "${GITHUB_ACTOR}" | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
| git fetch --tags | |
| if [ $(git tag -l "${{ steps.update.outputs.version }}") ]; then | |
| echo "Tag ${{ steps.update.outputs.version }} already exists! Skipping tag creation." | |
| else | |
| echo "Creating tag ${{ steps.update.outputs.version }}" | |
| git tag "${{ steps.update.outputs.version }}" | |
| git push origin "${{ steps.update.outputs.version }}" | |
| fi |