Compare commits

...

6 Commits

Author SHA1 Message Date
50655d26a6 rename to workflow.yaml
All checks were successful
Build and Deploy / build-and-push (pull_request) Successful in 28s
Build and Deploy / deploy-to-k8s (pull_request) Successful in 1s
2026-02-01 23:51:26 -08:00
c6c2426d3a fix k8s workflow
Some checks failed
Build and Deploy / build-and-push (pull_request) Successful in 28s
Build and Deploy / deploy-to-k8s (pull_request) Has been cancelled
2026-02-01 22:07:43 -08:00
f536dd7185 Merge branch 'feature-test' of git.chopark.home:wesscho/Catalog26 into feature-test
Some checks failed
Build and Deploy / build-and-push (pull_request) Successful in 8s
Build and Deploy / deploy-to-k8s (pull_request) Failing after 1s
2026-02-01 21:22:06 -08:00
282dbb8c35 use bitnami/kubectl container image 2026-02-01 21:21:44 -08:00
09705a5211 Merge branch 'master' into feature-test
Some checks failed
Build and Deploy / build-and-push (pull_request) Successful in 29s
Build and Deploy / deploy-to-k8s (pull_request) Failing after 1s
2026-02-02 05:13:08 +00:00
50474abd17 add k8s deployment
Some checks failed
Build and Deploy / build-and-push (pull_request) Failing after 10s
Build and Deploy / deploy-to-k8s (pull_request) Has been skipped
2026-02-01 21:09:21 -08:00
3 changed files with 66 additions and 33 deletions

View File

@@ -1,32 +0,0 @@
name: Gitea Actions Demo
run-name: ${{ github.actor }} is building and pushing 🚀
on: [push]
env:
REGISTRY: git.chopark.home
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Login to Gitea Registry
# We use single quotes around the secret to prevent shell interpretation
# and the VM IP to bypass the 'server' DNS issue.
run: |
echo '${{ secrets.REGISTRY_TOKEN }}' | \
docker login ${{ env.REGISTRY }} \
--username ${{ gitea.actor }} \
--password-stdin
- name: Build and Push Docker Image
run: |
docker build -t ${{ env.REGISTRY }}/${{ gitea.repository }}:latest .
docker push ${{ env.REGISTRY }}/${{ gitea.repository }}:latest
- name: List files in the repository
run: ls ${{ github.workspace }}
- run: echo "🍏 Build and Push status is ${{ job.status }}."

View File

@@ -0,0 +1,65 @@
name: Build and Deploy
run-name: ${{ github.actor }} is building and pushing 🚀
on:
pull_request:
branches:
- master
env:
REGISTRY: git.chopark.home
IMAGE: ${{ gitea.repository }} # wesscho/catalog26
DEPLOYMENT_NAME: catalog26-deployment # my deployment name
CONTAINER_NAME: catalog26 # <-- MUST match spec.template.spec.containers[].name
NAMESPACE: catalog # my namespace
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Login to Gitea Registry
# We use single quotes around the secret to prevent shell interpretation
# and the VM IP to bypass the 'server' DNS issue.
run: |
echo '${{ secrets.REGISTRY_TOKEN }}' | \
docker login ${{ env.REGISTRY }} \
--username ${{ gitea.actor }} \
--password-stdin
- name: Build and Push Docker Image
run: |
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
container:
image: bitnami/kubectl:latest
steps:
- name: Set Kubeconfig
run: |
echo "${{ secrets.KUBE_CONFIG }}" > kubeconfig.yaml
- name: Update Deployment Image
env:
KUBECONFIG: kubeconfig.yaml
run: |
set -euo pipefail
kubectl set image \
"deployment/${DEPLOYMENT_NAME}" \
"${CONTAINER_NAME}=${REGISTRY}/${IMAGE}:latest" \
-n "${NAMESPACE}"
# Optional: wait for rollout to complete (recommended)
kubectl rollout status "deployment/${DEPLOYMENT_NAME}" -n "${NAMESPACE}"

View File

@@ -22,7 +22,7 @@ spec:
spec:
containers:
- name: catalog26
image: registry.chopark.home/catalog26:latest # Or yourusername/catalog26:latest for Docker Hub
image: git.chopark.home/wesscho/catalog26:latest
imagePullPolicy: Always
ports:
- containerPort: 8080 # This must match your Dockerfile EXPOSE port