68 строки
2.3 KiB
YAML
68 строки
2.3 KiB
YAML
# Java Player Workflow.
|
|
|
|
name: JavaPlayer
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
paths:
|
|
- Source/Services/RPSLS.JavaPlayer.Api/**
|
|
- .github/workflows/java_player_cicd.yml
|
|
- Deploy/helm/java-player/**
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
buildpush:
|
|
runs-on: ubuntu-16.04
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Build the Docker image
|
|
working-directory: Source/Services/RPSLS.JavaPlayer.Api
|
|
run: docker build . --file Dockerfile --tag ${{ secrets.ACR_NAME }}.azurecr.io/java.player:gh-${{ github.sha }}
|
|
- name: Login to Azure
|
|
uses: azure/login@v1
|
|
with:
|
|
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
|
- name: Set Azure subscription
|
|
run: |
|
|
az account set -s ${{ secrets.AZURE_SUBSCRIPTION }}
|
|
- name: Docker push
|
|
run: |
|
|
az acr login -n ${{ secrets.ACR_NAME }}
|
|
docker push ${{ secrets.ACR_NAME }}.azurecr.io/java.player:gh-${{ github.sha }}
|
|
- name: Set AKS kubectl context
|
|
uses: azure/aks-set-context@v1
|
|
with:
|
|
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
|
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
|
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
- name: Init Helm
|
|
run: |
|
|
az acr helm repo add -n ${{ secrets.ACR_NAME }}
|
|
- name: Package Helm chart
|
|
run: |
|
|
helm package Deploy/helm/java-player -d Deploy/helm/__charts --version 1.0.0-${{ github.sha }}
|
|
- name: Upload chart to ACR
|
|
run: |
|
|
az acr helm push Deploy/helm/__charts/java-player-1.0.0-${{ github.sha }}.tgz -n ${{ secrets.ACR_NAME }}
|
|
- name: Generate config file
|
|
shell: pwsh
|
|
run: |
|
|
az extension add --name application-insights
|
|
Deploy/powershell/Generate-Config.ps1 -gvaluesTemplate gvalues.template.gh -resourceGroup ${{ secrets.RESOURCE_GROUP }} -outputFile _values-gh.yaml -aksHost ${{ secrets.AKS_HOST }} -resourceGroupAcr ${{ secrets.RESOURCE_GROUP_ACR }}
|
|
- name: Install Helm Chart
|
|
run: |
|
|
helm repo update
|
|
helm upgrade --install -f Deploy/powershell/_values-gh.yaml --set image.repository=${{ secrets.ACR_NAME }}.azurecr.io/java.player --set image.tag=gh-${{ github.sha }} --set replicaCount=2 java-player ${{ secrets.ACR_NAME }}/java-player --version=1.0.0-${{ github.sha }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|