Skip to content

Commit

Permalink
updated action versions
Browse files Browse the repository at this point in the history
  • Loading branch information
sondre81 committed Sep 26, 2023
1 parent 4179ca9 commit 3caa859
Showing 1 changed file with 45 additions and 35 deletions.
80 changes: 45 additions & 35 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -21,25 +21,25 @@ 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 }}
password: ${{ secrets.GITHUB_TOKEN }}

- 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
Expand All @@ -48,48 +48,58 @@ 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: |
${{ steps.meta.outputs.tags }}
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
# ## 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

0 comments on commit 3caa859

Please sign in to comment.