diff --git a/.github/workflows/build_and_upload_docker_image_rclone_with_config.yml b/.github/workflows/build_and_upload_docker_image_rclone_with_config.yml index 7ff197bdc..ee1c0032d 100644 --- a/.github/workflows/build_and_upload_docker_image_rclone_with_config.yml +++ b/.github/workflows/build_and_upload_docker_image_rclone_with_config.yml @@ -1,9 +1,13 @@ name: Build and Upload Docker Image of Rclone With Config to GHCR on: - schedule: - - cron: "0 16 * * 1" # Weekly at noon EST on Monday workflow_dispatch: + workflow_call: + secrets: + DOCKER_UPLOADER_USERNAME: + required: true + DOCKER_UPLOADER_PASSWORD: + required: true concurrency: # Cancel previous workflows on the same pull request group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/weeklies.yml b/.github/workflows/weeklies.yml new file mode 100644 index 000000000..8397fcbd7 --- /dev/null +++ b/.github/workflows/weeklies.yml @@ -0,0 +1,29 @@ +name: Weekly workflows + +on: + workflow_dispatch: + schedule: + - cron: "0 2 * * 0" # Weekly at 6PM PST, 9PM EST, 3AM CET on Sunday to avoid working hours + +jobs: + build-and-upload-docker-image-rclone-with-config: + uses: ./.github/workflows/build_and_upload_docker_image_rclone_with_config.yml + secrets: + DOCKER_UPLOADER_USERNAME: ${{ secrets.DOCKER_UPLOADER_USERNAME }} + DOCKER_UPLOADER_PASSWORD: ${{ secrets.DOCKER_UPLOADER_PASSWORD }} + + notify-build-and-upload-docker-image-rclone-with-config: + runs-on: ubuntu-latest + needs: [build-and-upload-docker-image-rclone-with-config] + if: ${{ always() && needs.build-and-upload-docker-image-rclone-with-config.result == 'failure' }} + steps: + - uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 465 + username: ${{ secrets.MAIL_USERNAME }} + password: ${{ secrets.MAIL_PASSWORD }} + subject: NeuroConv Weekly Docker Image Build and Upload Failure + to: ${{ secrets.DAILY_FAILURE_EMAIL_LIST }} + from: NeuroConv + body: "The weekly build and upload of the Docker image failed, please check status at https://github.com/catalystneuro/neuroconv/actions/workflows/weeklies.yml" diff --git a/CHANGELOG.md b/CHANGELOG.md index dc8d4112d..78fed6276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ## Improvements * Run only the most basic testing while a PR is on draft [PR #1082](https://github.com/catalystneuro/neuroconv/pull/1082) +* Consolidated weekly workflows into one workflow and added email notifications [PR #1088](https://github.com/catalystneuro/neuroconv/pull/1088) * Avoid running link test when the PR is on draft [PR #1093](https://github.com/catalystneuro/neuroconv/pull/1093)