diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d2ca10a..d97b8b9 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -103,25 +103,17 @@ jobs: - name: 🕰️ Create Cloud Scheduler run: | - if [ ! "$(gcloud scheduler jobs list --location=us-central1 | grep $SCHEDULE_NAME)" ]; then - gcloud scheduler jobs create pubsub $SCHEDULE_NAME \ - --description="$SCHEDULE_DESCRIPTION" \ - --schedule="$SCHEDULE_CRON" \ - --time-zone=America/Denver \ - --location=us-central1 \ - --topic=$SCHEDULE_NAME-topic \ - --message-body='{"run": "now"}' \ - --quiet - else - gcloud scheduler jobs update pubsub $SCHEDULE_NAME \ - --description="$SCHEDULE_DESCRIPTION" \ - --schedule="$SCHEDULE_CRON" \ - --time-zone=America/Denver \ - --location=us-central1 \ - --topic=$SCHEDULE_NAME-topic \ - --message-body='{"run": "now"}' \ - --quiet - fi + for i in $(gcloud scheduler jobs list --location=us-central1 --uri); do + gcloud scheduler jobs delete $i --quiet + done + gcloud scheduler jobs create pubsub $SCHEDULE_NAME \ + --description="$SCHEDULE_DESCRIPTION" \ + --schedule="$SCHEDULE_CRON" \ + --time-zone=America/Denver \ + --location=us-central1 \ + --topic=$SCHEDULE_NAME-topic \ + --message-body='{"run": "now"}' \ + --quiet deploy-prod: name: Deploy to GCF - prod @@ -177,25 +169,17 @@ jobs: - name: 🕰️ Create Cloud Scheduler run: | - if [ ! "$(gcloud scheduler jobs list --location=us-central1 | grep $SCHEDULE_NAME)" ]; then - gcloud scheduler jobs create pubsub $SCHEDULE_NAME \ - --description="$SCHEDULE_DESCRIPTION" \ - --schedule="$SCHEDULE_CRON" \ - --time-zone=America/Denver \ - --location=us-central1 \ - --topic=$SCHEDULE_NAME-topic \ - --message-body='{"run": "now"}' \ - --quiet - else - gcloud scheduler jobs update pubsub $SCHEDULE_NAME \ - --description="$SCHEDULE_DESCRIPTION" \ - --schedule="$SCHEDULE_CRON" \ - --time-zone=America/Denver \ - --location=us-central1 \ - --topic=$SCHEDULE_NAME-topic \ - --message-body='{"run": "now"}' \ - --quiet - fi + for i in $(gcloud scheduler jobs list --location=us-central1 --uri); do + gcloud scheduler jobs delete $i --quiet + done + gcloud scheduler jobs create pubsub $SCHEDULE_NAME \ + --description="$SCHEDULE_DESCRIPTION" \ + --schedule="$SCHEDULE_CRON" \ + --time-zone=America/Denver \ + --location=us-central1 \ + --topic=$SCHEDULE_NAME-topic \ + --message-body='{"run": "now"}' \ + --quiet - name: 🔔 Create deployment notification uses: agrc/service-now-worknote-action@v1