diff options
author | morpheus65535 <[email protected]> | 2021-03-27 15:15:28 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2021-03-27 15:15:28 -0400 |
commit | a57e7fbb7d23d18b8f0f3ccaf37f047e6858ab30 (patch) | |
tree | 44fe80d1d9dd09e31535557f02cb753720e1d9f8 | |
parent | 14fe4b0594739b3499c3124bcd6883253cd2020a (diff) | |
parent | d5dd54d74fe68ea26eb37732bb7928ca5b8568bc (diff) | |
download | bazarr-a57e7fbb7d23d18b8f0f3ccaf37f047e6858ab30.tar.gz bazarr-a57e7fbb7d23d18b8f0f3ccaf37f047e6858ab30.zip |
Merge remote-tracking branch 'origin/development' into development
-rw-r--r-- | .github/workflows/ci.yml | 7 | ||||
-rw-r--r-- | .github/workflows/schedule.yaml | 50 |
2 files changed, 54 insertions, 3 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe3c0b803..c4d1f73e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,11 +3,12 @@ name: CI on: push: branches: [development] + paths: + - frontend/** + - .github/workflows/ci.yml pull_request: branches: [development] - paths: - - frontend/** - - .github/workflows/ci.yml + jobs: Frontend: diff --git a/.github/workflows/schedule.yaml b/.github/workflows/schedule.yaml new file mode 100644 index 000000000..57ce3de97 --- /dev/null +++ b/.github/workflows/schedule.yaml @@ -0,0 +1,50 @@ +name: Schedule Trigger + +on: + schedule: + - cron: '0 6 * * *' + +jobs: + Release-Nightly: + runs-on: ubuntu-latest + env: + GITHUB_REPO: "morpheus65535/bazarr" + GIT_BRANCH: "development" + WORKFLOW_TO_TRIGGER: "release_beta_to_dev.yaml" + steps: + - name: Get Previous Version + uses: actions/cache@v2 + with: + path: ./LAST_VERSION_SAVED + key: bazarr-${{ env.GIT_BRANCH }}-${{ env.WORKFLOW_TO_TRIGGER }}-trigger + - name: Execute + run: | + echo "**** Checking branch ${{ env.GIT_BRANCH }} ****" + LATEST_VERSION=$(git ls-remote https://github.com/${{ env.GITHUB_REPO }}.git refs/heads/${{ env.GIT_BRANCH }} | cut -f1) + if [[ $? != 0 ]]; then + echo "**** Cannot get latest hash from GitHub, exiting... ****" + exit 1 + fi + FILE_TO_CHECK='./LAST_VERSION_SAVED' + PREV_VERSION=0 + [[ -f $FILE_TO_CHECK ]] && PREV_VERSION=$(cat $FILE_TO_CHECK) + echo "**** Previous version: $PREV_VERSION ****" + echo "**** Latest version: $LATEST_VERSION ****" + echo $LATEST_VERSION > $FILE_TO_CHECK + if [[ 16#$LATEST_VERSION -eq 16#$PREV_VERSION ]]; then + echo "**** No Changes Found ****" + else + echo "**** Changes Found ****" + if curl -sfX GET https://raw.githubusercontent.com/${{ env.GITHUB_REPO }}/${{ env.GIT_BRANCH }}/.github/workflows/${{ env.WORKFLOW_TO_TRIGGER }} > /dev/null 2>&1; then + echo "**** Workflow exists. Triggering workflow for branch ${{ env.GIT_BRANCH }} ****" + curl -iX POST \ + -H "Authorization: token ${{ secrets.WF_GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + -d "{\"ref\":\"refs/heads/${{ env.GIT_BRANCH }}\"}" \ + https://api.github.com/repos/${{ env.GITHUB_REPO }}/actions/workflows/${{ env.WORKFLOW_TO_TRIGGER }}/dispatches + else + echo "**** Workflow doesn't exist! Skipping... ****" + fi + fi + + |