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 46196fc commit e28fed2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/docker-build-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
push:
tags:
- openadkit-v*.*.*
branches:
- main
schedule:
- cron: 0 12 * * *
workflow_dispatch:
Expand Down Expand Up @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ on:
push:
tags:
- openadkit-v*.*.*
branches:
- main
schedule:
- cron: 0 12 * * *
workflow_dispatch:
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit e28fed2

Please sign in to comment.