Skip to content

Commit

Permalink
Add deploy_aks
Browse files Browse the repository at this point in the history
  • Loading branch information
johnake committed Sep 12, 2023
1 parent da94aa7 commit 483aa0d
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions/deploy_v2/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ runs:

- name: Terraform init, plan & apply
shell: bash
run: make ci ${{ inputs.environment }} terraform-apply-aks
run: make ci ${{ inputs.environment }} terraform-plan-aks
env:
ARM_ACCESS_KEY: ${{ inputs.arm-access-key }}
DOCKER_IMAGE: ${{ inputs.docker_image }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: "Deploy environment ( dev, test, preprod or production )"
required: true
default: dev
type: environment
type: choice
options:
- dev
- test
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/deploy_aks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Manual deployment
on:
workflow_dispatch:
inputs:
environment:
description: "Deploy environment ( development_aks, test, preprod or production )"
required: true
default: development_aks
type: choice
options:
- development_aks
sha:
description: Commit sha to be deployed
required: true
env:
CONTAINER_REGISTRY: ghcr.io

jobs:
deploy_v2_environment:
name: Deploy to ${{ github.event.inputs.environment }} environment
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
environment:
name: ${{ github.event.inputs.environment }}
steps:
- uses: actions/checkout@v3

- name: Docker image tag
id: image
run: |
echo ::set-output name=tag::$CONTAINER_REGISTRY/$(echo $GITHUB_REPOSITORY | tr '[:upper:]' '[:lower:]'):$INPUT_GITHUB_SHA
env:
CONTAINER_REGISTRY: ${{ env.CONTAINER_REGISTRY }}
INPUT_GITHUB_SHA: ${{ inputs.sha }}
shell: bash

- uses: ./.github/workflows/actions/deploy_v2
id: deploy
with:
environment_name: ${{ github.event.inputs.environment }}
docker_image: ${{ steps.image.outputs.tag }}
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
arm-access-key: ${{ secrets.ARM_ACCESS_KEY }}

- uses: ./.github/workflows/actions/smoke-test-v2
id: smoke-test
with:
environment: development_aks
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}

0 comments on commit 483aa0d

Please sign in to comment.