-
Notifications
You must be signed in to change notification settings - Fork 577
39 lines (39 loc) · 1.45 KB
/
deploy-cluster.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
name: Deploy cluster
on:
workflow_dispatch:
inputs:
clusterSize:
type: choice
options:
- M10
- M20
schedule:
# We deploy three times per day,
# to avoid downtime as the cluster gets deleted after 12 hours
- cron: '0 6,14,22 * * *' # 6:00, 14:00, 22:00 every day
jobs:
deploy-cluster:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy cluster
uses: realm/ci-actions/mdb-realm/deploy@043cc5a8446748b823957c6ea4d08e6e495ea996
id: deploy-cluster
with:
atlasUrl: ${{ secrets.ATLAS_QA_BASE_URL }}
projectId: ${{ secrets.ATLAS_QA_PROJECT_ID }}
apiKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
privateApiKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}
clusterSize: ${{ github.event.inputs.clusterSize || 'M20' }}
- name: Update GitHub secret
run: gh secret set ATLAS_QA_DAILY_CLUSTER_NAME --body ${{ steps.deploy-cluster.outputs.clusterName }}
env:
GH_TOKEN: ${{ secrets.REALM_CI_PAT }}
- name: Delete apps used > 24 hours ago
uses: realm/ci-actions/mdb-realm/deleteOldApps@kh/delete-old-apps
id: delete-old-apps
with:
atlasUrl: ${{ secrets.ATLAS_QA_BASE_URL }}
projectId: ${{ secrets.ATLAS_QA_PROJECT_ID }}
apiKey: ${{ secrets.ATLAS_QA_PUBLIC_API_KEY }}
privateApiKey: ${{ secrets.ATLAS_QA_PRIVATE_API_KEY }}