From fd8a8a5e5fea135fe0af15834e23768f6509f135 Mon Sep 17 00:00:00 2001 From: Jeff Culverhouse Date: Wed, 8 Oct 2025 23:37:21 -0400 Subject: [PATCH] chore: normalize github deploy actions --- .github/workflows/deploy.yaml | 25 +++++-------------------- app.py | 2 +- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b5eeacd..c5846e2 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,7 +6,7 @@ on: - "main" workflow_dispatch: schedule: - - cron: "0 3 1 * *" # Runs at 03:00 UTC on the 1st of each month + - cron: "0 3 1 * *" # Monthly rebuild at 03:00 UTC on the 1st permissions: contents: write @@ -18,9 +18,9 @@ jobs: release: name: Semantic Release runs-on: ubuntu-latest + if: github.event_name != 'schedule' outputs: release_tag: ${{ steps.get_release.outputs.release_tag }} - release_notes: ${{ steps.semantic.outputs.release_notes }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -39,12 +39,7 @@ jobs: id: semantic env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - npx semantic-release - RELEASE_NOTES=$(npx semantic-release --dry-run | grep -A100 "Next release version" || true) - echo "release_notes<> $GITHUB_OUTPUT - echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + run: npx semantic-release - name: Get latest release tag id: get_release @@ -52,24 +47,15 @@ jobs: TAG=$(git describe --tags --abbrev=0) echo "$TAG" > VERSION echo "release_tag=$TAG" >> $GITHUB_OUTPUT - - - name: Commit VERSION file - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add VERSION - git commit -m "chore: update VERSION to ${{ steps.get_release.outputs.release_tag }}" || echo "No changes to commit" - git push + echo "Found release tag: $TAG" docker: name: Build and Push Docker Image needs: [release] - if: | - github.event_name == 'schedule' || needs.release.result == 'success' + if: github.event_name == 'schedule' || needs.release.result == 'success' runs-on: ubuntu-latest env: RELEASE_TAG: ${{ needs.release.outputs.release_tag }} - RELEASE_NOTES: ${{ needs.release.outputs.release_notes }} steps: - name: Checkout code @@ -103,5 +89,4 @@ jobs: labels: | org.opencontainers.image.version=${{ env.RELEASE_TAG }} org.opencontainers.image.title=amcrest2mqtt - org.opencontainers.image.description=${{ env.RELEASE_NOTES }} org.opencontainers.image.source=${{ github.repository }} diff --git a/app.py b/app.py index 59d94d7..1ab2deb 100644 --- a/app.py +++ b/app.py @@ -93,7 +93,7 @@ logging.basicConfig( level=logging.INFO if config['debug'] == False else logging.DEBUG ) logger = logging.getLogger(__name__) -logger.info(f'Starting: amcrest2mqtt v{version}') +logger.info(f'Starting: amcrest2mqtt {version}') logger.info(f'Config loaded from {config["config_from"]}') # Check for required config properties