Skip to content

Commit

Permalink
deploy cron jobs (#2)
Browse files Browse the repository at this point in the history
* deploy cron jobs

* remove dev and staging for mail weekly
  • Loading branch information
SKairinos authored Aug 29, 2023
1 parent afd6be6 commit 9a379ab
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Cron

on:
push:
branches:
- main
paths:
- 'cron.yaml'
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 🛫 Checkout
uses: actions/checkout@v3

- name: 🗝 Authenticate with GCloud
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_CREDENTIALS }}

- name: 🤖 Set up GCloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: 🚀 Deploy Cron Jobs on GCloud
run: gcloud app deploy cron.yaml
135 changes: 135 additions & 0 deletions cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# https://cloud.google.com/appengine/docs/flexible/scheduling-jobs-with-cron-yaml#about
cron:
# ----------------------------------------------------------------------------
# Legacy system
# ----------------------------------------------------------------------------

# /mail/weekly/

- url: /mail/weekly/
schedule: every friday 09:00
timezone: Europe/London
target: default

# /cron/user/unverified/send-first-reminder/

- url: /cron/user/unverified/send-first-reminder/
schedule: every day 10:00
timezone: Europe/London
target: default

- url: /cron/user/unverified/send-first-reminder/
schedule: every day 10:00
timezone: Europe/London
target: dev

- url: /cron/user/unverified/send-first-reminder/
schedule: every day 10:00
timezone: Europe/London
target: staging

# /cron/user/unverified/send-second-reminder/

- url: /cron/user/unverified/send-second-reminder/
schedule: every day 10:00
timezone: Europe/London
target: default

- url: /cron/user/unverified/send-second-reminder/
schedule: every day 10:00
timezone: Europe/London
target: dev

- url: /cron/user/unverified/send-second-reminder/
schedule: every day 10:00
timezone: Europe/London
target: staging

# /cron/user/unverified/delete/

# - url: /cron/user/unverified/delete/
# schedule: every day 10:00
# timezone: Europe/London
# target: default

# - url: /cron/user/unverified/delete/
# schedule: every day 10:00
# timezone: Europe/London
# target: dev

# - url: /cron/user/unverified/delete/
# schedule: every day 10:00
# timezone: Europe/London
# target: staging

# ----------------------------------------------------------------------------
# New system
# ----------------------------------------------------------------------------

# /api/cron/session/clear-expired/

- url: /api/cron/session/clear-expired/
schedule: every day 00:00
timezone: Europe/London
target: development-portal

- url: /api/cron/session/clear-expired/
schedule: every day 00:00
timezone: Europe/London
target: staging-portal

- url: /api/cron/session/clear-expired/
schedule: every day 00:00
timezone: Europe/London
target: production-portal

# /api/cron/user/unverified/send-first-reminder/

- url: /api/cron/user/unverified/send-first-reminder/
schedule: every 24 hours
timezone: Europe/London
target: development-portal

- url: /api/cron/user/unverified/send-first-reminder/
schedule: every 24 hours
timezone: Europe/London
target: staging-portal

- url: /api/cron/user/unverified/send-first-reminder/
schedule: every 24 hours
timezone: Europe/London
target: production-portal

# /api/cron/user/unverified/send-second-reminder/

- url: /api/cron/user/unverified/send-second-reminder/
schedule: every 24 hours
timezone: Europe/London
target: development-portal

- url: /api/cron/user/unverified/send-second-reminder/
schedule: every 24 hours
timezone: Europe/London
target: staging-portal

- url: /api/cron/user/unverified/send-second-reminder/
schedule: every 24 hours
timezone: Europe/London
target: production-portal

# /api/cron/user/unverified/delete/

- url: /api/cron/user/unverified/delete/
schedule: every 24 hours
timezone: Europe/London
target: development-portal

- url: /api/cron/user/unverified/delete/
schedule: every 24 hours
timezone: Europe/London
target: staging-portal

- url: /api/cron/user/unverified/delete/
schedule: every 24 hours
timezone: Europe/London
target: production-portal

0 comments on commit 9a379ab

Please sign in to comment.