diff --git a/.github/workflows/build-and-deploy.yaml b/.github/workflows/build-and-deploy.yaml index 8553d09..b7def4c 100644 --- a/.github/workflows/build-and-deploy.yaml +++ b/.github/workflows/build-and-deploy.yaml @@ -7,10 +7,10 @@ on: env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} - ALPHA_CLUSTER_NAME: aks-alpha-fint-2021-11-18 - ALPHA_CLUSTER_RESOURCE_GROUP: rg-aks-alpha - API_CLUSTER_NAME: aks-api-fint-2022-02-08 - API_CLUSTER_RESOURCE_GROUP: rg-aks-api + ALPHA_CLUSTER_NAME: ${{vars.ALPHA_CLUSTER_NAME}} + ALPHA_CLUSTER_RESOURCE_GROUP: ${{vars.ALPHA_CLUSTER_RESOURCE_GROUP}} + API_CLUSTER_NAME: ${{vars.API_CLUSTER_NAME}} + API_CLUSTER_RESOURCE_GROUP: ${{vars.API_CLUSTER_RESOURCE_GROUP}} jobs: build-and-push-image: @@ -21,10 +21,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -32,14 +32,14 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=sha,enable=true,priority=100,prefix=sha-,suffix=,format=short - name: Build and push Docker image - uses: docker/build-push-action@v3.1.1 + uses: docker/build-push-action@v5 with: context: . push: true @@ -48,21 +48,26 @@ jobs: ## Alpha cluster ## - name: Bake alpha manifests with Kustomize - uses: azure/k8s-bake@v2.2 + uses: azure/k8s-bake@v2 with: renderEngine: 'kustomize' kustomizationPath: 'kustomize/overlays/alpha' id: bake-alpha + - uses: azure/use-kubelogin@v1.1 + with: + kubelogin-version: 'v0.0.26' + - name: Set the target Alpha cluster. - uses: azure/aks-set-context@v1 + uses: azure/aks-set-context@v3 with: - creds: '${{ secrets.AKS_ALPHA_FINT_GITHUB }}' cluster-name: ${{ env.ALPHA_CLUSTER_NAME }} resource-group: ${{ env.ALPHA_CLUSTER_RESOURCE_GROUP }} + admin: 'true' + use-kubelogin: 'true' - name: Deploy to Alpha - uses: azure/k8s-deploy@v4.4 + uses: azure/k8s-deploy@v4.9 with: manifests: ${{ steps.bake-alpha.outputs.manifestsBundle }} images: | @@ -70,26 +75,31 @@ jobs: namespace: flais-io action: deploy - ## Api cluster ## - - name: Bake api manifests with Kustomize - uses: azure/k8s-bake@v2.2 - with: - renderEngine: 'kustomize' - kustomizationPath: 'kustomize/overlays/api' - id: bake-api - - - name: Set the target Api cluster. - uses: azure/aks-set-context@v1 - with: - creds: '${{ secrets.AKS_API_FINT_GITHUB }}' - cluster-name: ${{ env.API_CLUSTER_NAME }} - resource-group: ${{ env.API_CLUSTER_RESOURCE_GROUP }} - - - name: Deploy to API - uses: azure/k8s-deploy@v4.4 - with: - manifests: ${{ steps.bake-API.outputs.manifestsBundle }} - images: | - ${{ steps.meta.outputs.tags }} - namespace: flais-io - action: deploy \ No newline at end of file +# ## Api cluster ## +# - name: Bake api manifests with Kustomize +# uses: azure/k8s-bake@v2 +# with: +# renderEngine: 'kustomize' +# kustomizationPath: 'kustomize/overlays/api' +# id: bake-api +# +# - uses: azure/use-kubelogin@v1.1 +# 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@v4.9 +# with: +# manifests: ${{ steps.bake-API.outputs.manifestsBundle }} +# images: | +# ${{ steps.meta.outputs.tags }} +# namespace: flais-io +# action: deploy \ No newline at end of file