Check for qBt update #56
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 for qBt update | |
on: | |
schedule: | |
- cron: '17 5 * * *' | |
workflow_dispatch: | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download previous release info | |
id: download-artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
name: qbt-release-info | |
workflow_conclusion: success | |
workflow: build.yml | |
if_no_artifact_found: warn | |
- name: Get latest release | |
id: get-qbt-release | |
uses: ./.github/actions/get-qbt-release | |
- name: Compare with previous release | |
id: compare-release | |
run: | | |
# Read the release info from the downloaded artifact | |
PREVIOUS_RELEASE=$(cat qbt-release-info 2> /dev/null || echo "NONE") | |
echo "PREVIOUS_RELEASE=$PREVIOUS_RELEASE" | |
# Compare the fetched release tag with the previous release tag | |
if [ "${{ steps.get-qbt-release.outputs.release_tag }}" == "$PREVIOUS_RELEASE" ]; then | |
echo release_changed=false | tee -a $GITHUB_OUTPUT | |
else | |
echo release_changed=true | tee -a $GITHUB_OUTPUT | |
fi | |
- name: Call workflow to build docker image | |
if: ${{ steps.compare-release.outputs.release_changed == 'true' }} | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: build.yml | |
inputs: '{ "push": true, "update_artifact": true }' |