diff --git a/.github/workflows/docker-build-self-hosted.yaml b/.github/workflows/docker-build-self-hosted.yaml index e6f5d5b7f08..8ea00c0cc7c 100644 --- a/.github/workflows/docker-build-self-hosted.yaml +++ b/.github/workflows/docker-build-self-hosted.yaml @@ -10,8 +10,6 @@ on: push: tags: - openadkit-v*.*.* - branches: - - main schedule: - cron: 0 12 * * * workflow_dispatch: @@ -48,6 +46,11 @@ jobs: lib_dir: aarch64 additional-tag-suffix: -cuda steps: + - name: Check if push day + run: | + if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi + if: ${{ github.event_name == 'schedule' }} + # https://github.com/actions/checkout/issues/211 - name: Change permission of workspace run: | @@ -89,7 +92,7 @@ jobs: *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-arm64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} - allow-push: true + allow-push: ${{ env.IS_PUSH_DAY == 'true' }} - name: Show disk space run: | diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 595dca5ba17..b4c3043962a 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -10,8 +10,6 @@ on: push: tags: - openadkit-v*.*.* - branches: - - main schedule: - cron: 0 12 * * * workflow_dispatch: @@ -48,6 +46,11 @@ jobs: lib_dir: x86_64 additional-tag-suffix: -cuda steps: + - name: Check if push day + run: | + if [ $(date +'%d') -eq 01 ] || [ $(date +'%d') -eq 15 ]; then echo "IS_PUSH_DAY=true" >> $GITHUB_ENV; else echo "IS_PUSH_DAY=false" >> $GITHUB_ENV; fi + if: ${{ github.event_name == 'schedule' }} + - name: Check out repository uses: actions/checkout@v4 @@ -84,7 +87,7 @@ jobs: *.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ matrix.name }},mode=max tag-suffix: ${{ matrix.additional-tag-suffix }}-amd64 tag-prefix: ${{ needs.load-env.outputs.rosdistro }} - allow-push: true + allow-push: ${{ env.IS_PUSH_DAY == 'true' }} - name: Show disk space run: |