-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (53 loc) · 1.8 KB
/
materialized-views.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
name: Run the Materialized Views Function
on:
schedule:
# Invoke at 6 UTC EST every day
- cron: '0 6 * * *'
workflow_dispatch:
inputs:
environment:
required: true
type: choice
description: The environment the workflow should run on.
options:
- dev
- staging
- preview
- production
jobs:
scheduled-materialized-views:
if: ${{ github.event_name == 'schedule' }}
strategy:
matrix:
environments: ["dev", "staging", "production"]
name: Run materialized views create on ${{ inputs.environment }}
runs-on: ubuntu-latest
environment: ${{ matrix.environments }}
env:
space: ${{ matrix.environments }}
steps:
- name: Run Command
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: gsa-tts-oros-fac
cf_space: ${{ env.space }}
command: cf run-task gsa-fac -k 2G -m 2G --name scheduled_create_materialized_views --command "python manage.py materialized_views --create"
dispatch-materialized-views:
if: ${{ github.event.inputs.environment != '' }}
name: Run materialized views create on ${{ inputs.environment }}
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
space: ${{ inputs.environment }}
steps:
- name: Run Command
uses: cloud-gov/cg-cli-tools@main
with:
cf_username: ${{ secrets.CF_USERNAME }}
cf_password: ${{ secrets.CF_PASSWORD }}
cf_org: gsa-tts-oros-fac
cf_space: ${{ env.space }}
command: cf run-task gsa-fac -k 2G -m 2G --name dispatch_create_materialized_views --command "python manage.py materialized_views --create"