Skip to content

Commit

Permalink
add push day check to docker build workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Oguz Ozturk <[email protected]>
  • Loading branch information
oguzkaganozt committed Jun 24, 2024
1 parent 48828f7 commit 991afca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/docker-build-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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: |
Expand Down Expand Up @@ -101,7 +106,7 @@ jobs:
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: true
allow-push: ${{ env.IS_PUSH_DAY == 'true' }}

- name: Show disk space
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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

Expand Down Expand Up @@ -96,7 +101,7 @@ jobs:
*.cache-to=type=registry,ref=ghcr.io/${{ github.repository }}-buildcache:${{ matrix.name }}-${{ matrix.platform }}-${{ github.ref_name }},mode=max
tag-suffix: ${{ matrix.additional-tag-suffix }}-${{ matrix.platform }}
tag-prefix: ${{ needs.load-env.outputs.rosdistro }}
allow-push: true
allow-push: ${{ env.IS_PUSH_DAY == 'true' }}

- name: Show disk space
run: |
Expand Down

0 comments on commit 991afca

Please sign in to comment.