refactor: CI 정리 (build+push only, REGISTRY_TOKEN)
Some checks failed
CI / build (push) Failing after 13s

This commit is contained in:
2026-03-28 07:49:42 +00:00
parent 7bb4f9e6c1
commit dcbd0d701c

View File

@@ -1,44 +1,29 @@
name: CI/CD
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: gitea.inouter.com
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Gitea Registry
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login gitea.inouter.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push Docker image
- name: Build and push
run: |
IMAGE=gitea.inouter.com/kaffa/haproxy-mcp
TAG=${GITHUB_SHA::8}
docker build \
--tag ${IMAGE}:${TAG} \
--tag ${IMAGE}:latest \
.
docker push ${IMAGE}:${TAG}
docker push ${IMAGE}:latest
- name: Deploy to K8s
run: |
mkdir -p ~/.kube
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
chmod 600 ~/.kube/config
IMAGE=gitea.inouter.com/kaffa/haproxy-mcp
TAG=${GITHUB_SHA::8}
kubectl apply -f k8s/
kubectl set image deployment/haproxy-mcp \
haproxy-mcp=${IMAGE}:${TAG} \
-n default
kubectl rollout status deployment/haproxy-mcp \
-n default --timeout=120s
SHORT_SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA} .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA}