blob: 3706a8347540ef3e15c7b9c2a238ac1d8d47869f [file] [log] [blame]
# Provide instructions for google Cloud Build to deploy cron jobs
# to flutter-dashboard project. It will be triggered
# by daily schedule on `main` branch.
#
# The deploy will be skipped if no new commits since last deployment.
steps:
# Deploy a new version to google cloud.
- name: gcr.io/cloud-builders/gcloud
entrypoint: '/bin/bash'
args:
- '-c'
- |-
gcloud config set project $PROJECT_ID
latest_version=$(gcloud app versions list --hide-no-traffic --format 'value(version.id)')
if [ "$latest_version" = "version-$SHORT_SHA" ]; then
echo "No updates since last deployment."
else
bash cloud_build/deploy_cron_jobs.sh $PROJECT_ID
fi
timeout: 600s