add secret ref to fint-portal-api #68
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
name: Deploy | |
#on: | |
# push: | |
# branches: | |
# - main | |
env: | |
REGISTRY_NAME: fintlabsacr | |
BETA_CLUSTER_NAME: aks-beta-fint-2021-11-23 | |
BETA_CLUSTER_RESOURCE_GROUP: rg-aks-beta | |
API_CLUSTER_NAME: aks-api-fint-2022-02-08 | |
API_CLUSTER_RESOURCE_GROUP: rg-aks-api | |
NAMESPACE: default | |
APP_NAME: fint-admin-portal | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Connect to Azure Container Registry (ACR) | |
uses: azure/docker-login@v1 | |
with: | |
login-server: ${{ env.REGISTRY_NAME }}.azurecr.io | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Container build and push to a Azure Container Registry (ACR) | |
run: | | |
docker build . -t ${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
- uses: azure/login@v1 | |
with: | |
creds: '${{ secrets.AKS_BETA_FINT_GITHUB }}' | |
- uses: azure/[email protected] | |
with: | |
kubelogin-version: 'v0.0.26' | |
- name: Set the target Beta cluster. | |
uses: azure/aks-set-context@v3 | |
with: | |
cluster-name: ${{ env.BETA_CLUSTER_NAME }} | |
resource-group: ${{ env.BETA_CLUSTER_RESOURCE_GROUP }} | |
admin: 'true' | |
use-kubelogin: 'true' | |
- name: Deploy to Beta | |
uses: azure/k8s-deploy@v1 | |
with: | |
manifests: | | |
k8s.yaml | |
images: | | |
${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
namespace: ${{ env.NAMESPACE }} | |
- uses: azure/login@v1 | |
with: | |
creds: '${{ secrets.AKS_API_FINT_GITHUB }}' | |
- uses: azure/[email protected] | |
with: | |
kubelogin-version: 'v0.0.26' | |
- name: Set the target Api cluster. | |
uses: azure/aks-set-context@v3 | |
with: | |
cluster-name: ${{ env.API_CLUSTER_NAME }} | |
resource-group: ${{ env.API_CLUSTER_RESOURCE_GROUP }} | |
admin: 'true' | |
use-kubelogin: 'true' | |
- name: Deploy to Api | |
uses: azure/k8s-deploy@v1 | |
with: | |
manifests: | | |
k8s.yaml | |
images: | | |
${{ env.REGISTRY_NAME }}.azurecr.io/${{ env.APP_NAME }}:${{ github.sha }} | |
namespace: ${{ env.NAMESPACE }} |