generated from xgeekshq/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update cicd to deploy split into k8s (#1576)
Co-authored-by: joaosousa <[email protected]>
- Loading branch information
1 parent
f76463d
commit c3555f1
Showing
2 changed files
with
49 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,26 +6,49 @@ on: | |
ENVIRONMENT: | ||
required: true | ||
type: string | ||
APP_NAME: | ||
CHART_OVERRIDE_PATH: | ||
required: true | ||
type: string | ||
REPOSITORY: | ||
required: true | ||
type: string | ||
secrets: | ||
PUBLISH_PROFILE: | ||
required: true | ||
|
||
env: | ||
TAG: ${{ github.sha }} | ||
CHART-PATH: './infrastructure/split' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.ENVIRONMENT }} | ||
steps: | ||
- uses: azure/webapps-deploy@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: "check is AZURE_CREDENTIALS exists" | ||
env: | ||
super_secret: ${{ secrets.AZURE_CREDENTIALS }} | ||
if: ${{ env.super_secret == '' }} | ||
run: 'echo "echo the secret \"AZURE_CREDENTIALS\" has not been made; echo please go to \"settings \> secrets \> actions\" to create it"' | ||
|
||
- name: Azure login | ||
uses: azure/login@v2 | ||
with: | ||
app-name: ${{ inputs.APP_NAME }} | ||
publish-profile: ${{ secrets.PUBLISH_PROFILE }} | ||
images: split.azurecr.io/${{ inputs.REPOSITORY }}:${{ env.TAG }} | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
# Use kubelogin to configure your kubeconfig for Azure auth | ||
- name: Set up kubelogin for non-interactive login | ||
uses: azure/use-kubelogin@v1 | ||
with: | ||
kubelogin-version: 'v0.0.25' | ||
|
||
- name: Set AKS context | ||
uses: azure/aks-set-context@v4 | ||
with: | ||
resource-group: '${{ secrets.RESOURCE_GROUP }}' | ||
cluster-name: '${{ secrets.CLUSTER_NAME }}' | ||
admin: 'false' | ||
use-kubelogin: 'true' | ||
|
||
- name: Install Helm | ||
uses: azure/[email protected] | ||
|
||
- name: Deploy | ||
#environment: ${{ inputs.ENVIRONMENT }} | ||
run: helm upgrade --install split ${{ env.CHART-PATH }} -f ${{ inputs.CHART_OVERRIDE_PATH }} --set global.image.tag=${{ env.TAG }} --namespace=split-${{ inputs.ENVIRONMENT }} --create-namespace --atomic |