Merge pull request 'add k8s deployment' (#3) from feature-test into master

Reviewed-on: https://git.chopark.home/wesscho/catalog26/pulls/3
This commit was merged in pull request #3.
This commit is contained in:
2026-02-02 05:13:17 +00:00

View File

@@ -1,12 +1,19 @@
name: Gitea Actions Demo
name: Build and Deploy
run-name: ${{ github.actor }} is building and pushing 🚀
on: [push]
on:
pull_request:
branches:
- master
env:
REGISTRY: git.chopark.home
IMAGE: ${{ gitea.repository }}
DEPLOYMENT_NAME: ${{ gitea.repository##*/ }}-deployment # optional generic name
CONTAINER_NAME: ${DEPLOYMENT_NAME} # optional generic container name
NAMESPACE: catalog # optional namespace for the deployment
jobs:
Explore-Gitea-Actions:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
@@ -23,10 +30,25 @@ jobs:
- name: Build and Push Docker Image
run: |
docker build -t ${{ env.REGISTRY }}/${{ gitea.repository }}:latest .
docker push ${{ env.REGISTRY }}/${{ gitea.repository }}:latest
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
- name: List files in the repository
run: ls ${{ github.workspace }}
- run: echo "🍏 Build and Push status is ${{ job.status }}."
deploy-to-k8s:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Set Kubeconfig
run: |
echo "${{ secrets.KUBE_CONFIG }}" > kubeconfig.yaml
- name: Update Deployment Image
run: |
# export KUBECONFIG=kubeconfig.yaml
kubectl set image \
deployment/${{ env.DEPLOYMENT_NAME }} \
${{ env.CONTAINER_NAME }}=${{ env.REGISTRY }}/${{ env.IMAGE }}:latest \
-n ${{ env.NAMESPACE }}