-
Notifications
You must be signed in to change notification settings - Fork 45
108 lines (103 loc) · 4.08 KB
/
ci-astro-deploy.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: "Astro Deploy"
on:
schedule:
- cron: '0 19 * * *'
workflow_dispatch:
inputs:
git_rev:
description: 'The git revision to deploy'
required: false
default: ''
environment_to_deploy:
description: 'astro cloud deployment to deploy to'
required: true
type: choice
options:
- both
- astro-sdk-integration-tests
- astro-sdk-integration-tests-on-KE
dags_to_trigger_after_deployment:
description: |
Comma separated list of dag_ids to trigger after deployment
(e.g. "example_mssql_transform, example_load_file")
required: false
type: string
default: ''
workflow_call:
inputs:
git_rev:
description: 'The git revision to deploy'
type: string
required: false
default: ''
environment_to_deploy:
description: 'astro cloud deployment to deploy to'
required: true
type: string
default: both
dags_to_trigger_after_deployment:
description: |
Comma separated list of dag_ids to trigger after deployment
(e.g. "example_mssql_transform, example_load_file")
required: false
type: string
default: ''
jobs:
deploy-to-astro-sdk-integration-tests:
if: |
contains(fromJSON('["both", "astro-sdk-integration-tests"]'), inputs.environment_to_deploy) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml
with:
git_rev: ${{ inputs.git_rev }}
environment_to_deploy: 'astro-sdk-integration-tests'
secrets:
docker_registry: ${{ secrets.ASTRO_DOCKER_REGISTRY }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID }}
bearer_token: ${{ secrets.BEARER_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
wait-for-deployment-to-be-ready-and-trigger-dags-for-astro-sdk-integration-tests:
if: |
github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && inputs.dags_to_trigger_after_deployment != '')
needs: deploy-to-astro-sdk-integration-tests
uses: ./.github/workflows/reuse-wf-trigger-dag.yaml
with:
git_rev: ${{ inputs.git_rev }}
dags_to_trigger_after_deployment: ${{ inputs.dags_to_trigger_after_deployment }}
secrets:
astro_subdomain: ${{ secrets.ASTRO_SUBDOMAIN }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID }}
bearer_token: ${{ secrets.BEARER_TOKEN }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deploy-to-astro-sdk-integration-tests-on-KE:
if: |
contains(fromJSON('["both", "astro-sdk-integration-tests-on-KE"]'), inputs.environment_to_deploy) ||
github.event_name == 'schedule'
uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml
with:
git_rev: ${{ inputs.git_rev }}
environment_to_deploy: 'astro-sdk-integration-tests-on-KE'
secrets:
docker_registry: ${{ secrets.ASTRO_DOCKER_REGISTRY }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID_KE }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
bearer_token: ${{ secrets.BEARER_TOKEN }}
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
wait-for-deployment-to-be-ready-and-trigger-dags-for-astro-sdk-integration-tests-on-KE:
if: |
github.event_name == 'schedule' ||
(github.event_name == 'workflow_dispatch' && inputs.dags_to_trigger_after_deployment != '')
needs: deploy-to-astro-sdk-integration-tests-on-KE
uses: ./.github/workflows/reuse-wf-trigger-dag.yaml
with:
git_rev: ${{ inputs.git_rev }}
dags_to_trigger_after_deployment: ${{ inputs.dags_to_trigger_after_deployment }}
secrets:
astro_subdomain: ${{ secrets.ASTRO_SUBDOMAIN }}
deployment_id: ${{ secrets.ASTRO_DEPLOYMENT_ID_KE }}
organization_id: ${{ secrets.ORGANIZATION_ID }}
bearer_token: ${{ secrets.BEARER_TOKEN }}