-
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (93 loc) · 3.42 KB
/
qat-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
name: qat-deploy
on:
push:
branches:
[qat]
jobs:
secrets-gate-run:
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check-secrets-run.outputs.ok }}
steps:
- name: check for secrets needed to run workflows
id: check-secrets-run
run: |
if [ ${{ secrets.DEPLOYMENTS_ENABLED }} == 'true' ]; then
echo "::set-output name=ok::enabled"
fi
secrets-gate-webhook:
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check-secrets-webhook.outputs.ok }}
steps:
- name: check for secrets needed to run workflows
id: check-secrets-webhook
run: |
if [ ${{ secrets.SEND_FINISHED_WEBHOOK }} == 'true' ]; then
echo "::set-output name=ok::enabled"
fi
qat-deploy:
needs:
- secrets-gate-run
if: ${{ needs.secrets-gate-run.outputs.ok == 'enabled' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Setup Helm
run: scripts/setup_helm_builder.sh
- name: Setup AWS
run: scripts/setup_aws_builder.sh $AWS_ACCESS_KEY $AWS_SECRET $AWS_REGION $CLUSTER_NAME
env:
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET: ${{ secrets.AWS_SECRET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }}
- name: Space debug
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Build Docker Image
run: bash scripts/build_docker_builder.sh qat $DOCKER_LABEL $PRIVATE_ECR $AWS_REGION
env:
DOCKER_LABEL: ${{ secrets.DOCKER_LABEL }}
REPO_NAME: ${{ secrets.QAT_REPO_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
ECR_URL: ${{ secrets.ECR_URL }}
PRIVATE_ECR: ${{ secrets.PRIVATE_ECR }}
- name: delete package.json
run: rm package.json
- name: npm-install 'cli' and 'aws-sdk'
run: npm install cli aws-sdk
- name: Publish to Elastic Container Registry
run: bash scripts/publish_ecr_builder.sh qat $GITHUB_SHA $DOCKER_LABEL $PRIVATE_ECR $AWS_REGION
env:
DOCKER_LABEL: ${{ secrets.DOCKER_LABEL }}
REPO_NAME: ${{ secrets.QAT_REPO_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
ECR_URL: ${{ secrets.ECR_URL }}
PRIVATE_ECR: ${{ secrets.PRIVATE_ECR }}
- name: Deploy to EKS
run: bash scripts/deploy_builder.sh qat $GITHUB_SHA
- name: Run bot tests in Cluster
run: bash scripts/check-testbot.sh qat $GITHUB_SHA
- name: Job succeeded
if: ${{ needs.secrets-gate-webhook.outputs.ok == 'enabled' }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
run: |
git clone https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
shell: bash