Skip to content

Commit

Permalink
ci: run scheduled release once a month
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaycicekli committed Sep 19, 2024
1 parent 71796ae commit 63ec150
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/scheduled-docker-publish-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ on:
name: Scheduled - Build and Push to ECR (prod)

jobs:
# The workflow should work only in the first week of the month
check-first-week:
runs-on: ubuntu-latest
outputs:
is-first-week-of-month: ${{ steps.check-week.outputs.is-first-week }}
steps:
- name: Check if it's the first week of the month
id: check-week
run: |
if [ $(date +'%d' | sed 's/^0*//') -le 7 ]; then
echo "is-first-week=true" >> $GITHUB_OUTPUT
else
echo "is-first-week=false" >> $GITHUB_OUTPUT
fi
get-latest-tag:
needs: check-first-week
if: ${{ needs.check-first-week.outputs.is-first-week-of-month == 'true' }}
name: "Get latest tag"
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 63ec150

Please sign in to comment.