mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
Update k8s manifest
This commit is contained in:
@@ -2,12 +2,12 @@ name: Build and Deploy to Kubernetes
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ] # Trigger the action on push to main branch
|
||||
branches: [ main ]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
K8S_NAMESPACE: default # Replace with your Kubernetes namespace
|
||||
K8S_NAMESPACE: apps
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
@@ -33,10 +33,12 @@ jobs:
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
# Build and push main application image
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile
|
||||
push: true
|
||||
tags: |-
|
||||
${{ steps.meta.outputs.tags }}
|
||||
@@ -50,7 +52,7 @@ jobs:
|
||||
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
|
||||
with:
|
||||
args: |-
|
||||
# Update the deployment.yaml with the new image tag
|
||||
# Update both deployments with new image tags
|
||||
sed -i 's|image: .*|image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:1.0.${{ github.run_number }}|' k8s/manifest.yaml
|
||||
# Apply Kubernetes manifests
|
||||
kubectl apply -n apps -f k8s/manifest.yaml
|
||||
kubectl apply -n ${{ env.K8S_NAMESPACE }} -f k8s/manifest.yaml
|
||||
|
||||
Reference in New Issue
Block a user