-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (84 loc) · 2.67 KB
/
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
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: Deploy infra
run-name: >-
${{
format('Deploy infra version {0} to {1}',
inputs.version,
inputs.environment
)
}}
env:
PROJECT: acs-team-automation
on:
workflow_dispatch:
inputs:
environment:
description: Dev or Prod?
required: true
default: development
type: choice
options:
- development
- production
version:
description: Version, expanded to Github + Docker image tag
required: true
jobs:
wait-for-images:
runs-on: ubuntu-latest
strategy:
matrix:
image: [infra-server, infra-certifier]
steps:
- name: Wait for image
uses: stackrox/actions/release/wait-for-image@v1
with:
token: ${{ secrets.QUAY_RHACS_ENG_BEARER_TOKEN }}
image: rhacs-eng/${{ matrix.image }}:${{ inputs.version }}
limit: 1800
deploy:
runs-on: ubuntu-latest
needs: [wait-for-images]
steps:
- name: Show inputs
run: |
echo "Environment: ${{ inputs.environment }}"
echo "Version: ${{ inputs.version }}"
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.version }}
- name: Authenticate to GCloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.INFRA_DEPLOY_AUTOMATION_GCP_SA }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
install_components: "gke-gcloud-auth-plugin"
- name: Deploy to ${{ inputs.environment }}
env:
USE_GKE_GCLOUD_AUTH_PLUGIN: "True"
run: |
gcloud container clusters get-credentials infra-${{ inputs.environment }} \
--project "${PROJECT}" \
--region us-west2
ENVIRONMENT=${{ inputs.environment }} make install-argo clean-argo-config install-monitoring helm-deploy
- name: Notify infra channel about new version
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: slackapi/[email protected]
with:
channel-id: CVANK5K5W #acs-infra
payload: >-
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":ship::tada:*Infra (${{ inputs.environment }}) was updated to ${{ inputs.version }}.*\nTo see the latest changes, click <${{ github.server_url }}/${{ github.repository }}/blob/${{ inputs.version }}/CHANGELOG.md|here>."
}
}
]
}