Skip to content

Deploy infra version 0.8.3-4-g99144f3a55 to development #57

Deploy infra version 0.8.3-4-g99144f3a55 to development

Deploy infra version 0.8.3-4-g99144f3a55 to development #57

Workflow file for this run

name: Deploy infra
run-name: >-
${{
format('Deploy infra version {0} to {1}',
inputs.version,
inputs.environment
)
}}
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:
deploy:
runs-on: ubuntu-latest
steps:
- name: Show inputs
run: |
echo "Environment: ${{ inputs.environment }}"
echo "Version: ${{ inputs.version }}"
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.version }}
- name: Authenticate to GCloud
uses: google-github-actions/auth@v0
with:
credentials_json: ${{ secrets.GCP_INFRA_DEPLOY_AUTOMATION_SA }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v0'
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 stackrox-infra \
--region us-west2
ENVIRONMENT=${{ inputs.environment }} make install-argo clean-argo-config helm-deploy
- name: Notify infra channel about new version
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: slackapi/slack-github-action@v1.23.0
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>."
}
}
]
}