forked from hail-is/hail
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (40 loc) · 1.94 KB
/
prod_deploy.yaml
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
name: prod-deploy
on:
push:
branches:
- main
jobs:
invoke-prod-deploy:
runs-on: ubuntu-latest
steps:
- name: deploy to GCP
continue-on-error: true
run: |
DEPLOY_BATCH_URL_GCP=$(curl --fail --silent --show-error -X POST \
-H "Authorization: Bearer ${{ secrets.CI_TOKEN }}" \
-H "Content-Type:application/json" \
-d '{"steps": ["deploy_auth", "deploy_batch", "deploy_ci", "deploy_hailgenetics_image", "deploy_wheel", "upload_query_jar"], "sha": "${{ github.sha }}"}' \
https://ci.hail.populationgenomics.org.au/api/v1alpha/prod_deploy || echo "failed")
echo DEPLOY_BATCH_URL_GCP="$DEPLOY_BATCH_URL_GCP" >> $GITHUB_ENV
- name: deploy to Azure
continue-on-error: true
run: |
DEPLOY_BATCH_URL_AZURE=$(curl --fail --silent --show-error -X POST \
-H "Authorization: Bearer ${{ secrets.CI_TOKEN_AZURE }}" \
-H "Content-Type:application/json" \
-d '{"steps": ["deploy_auth", "deploy_batch", "deploy_ci", "upload_query_jar"], "sha": "${{ github.sha }}"}' \
https://ci.azhail.populationgenomics.org.au/api/v1alpha/prod_deploy || echo "failed")
echo DEPLOY_BATCH_URL_AZURE="$DEPLOY_BATCH_URL_AZURE" >> $GITHUB_ENV
- name: post to Slack
run: |
SLACK_MSG="Deploying Hail Batch:\n*GCP:* $DEPLOY_BATCH_URL_GCP\n*Azure:* $DEPLOY_BATCH_URL_AZURE"
curl --fail --silent --show-error -X POST \
-H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" \
-H "Content-type: application/json" \
-d "{\"channel\": \"production-announcements\", \"text\": \"$SLACK_MSG\"}" \
https://slack.com/api/chat.postMessage
- name: check if any deploy failed
run: |
if [ "$DEPLOY_BATCH_URL_GCP" == "failed" ] || [ "$DEPLOY_BATCH_URL_AZURE" == "failed" ]; then
exit 1
fi