ci: Simplify workflow for act_runner Docker environment
Remove buildx action and test job, use direct docker build/push and mounted kubectl for k8s deployment. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,38 +7,12 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: '3.11'
|
|
||||||
|
|
||||||
- name: Install uv
|
|
||||||
run: pip install uv
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: uv pip install --system -e "haproxy_mcp[dev]" || uv pip install --system -e haproxy_mcp
|
|
||||||
|
|
||||||
- name: Lint with ruff
|
|
||||||
run: ruff check . || true
|
|
||||||
|
|
||||||
- name: Type check
|
|
||||||
run: mypy . --ignore-missing-imports || true
|
|
||||||
|
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
needs: test
|
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Login to Gitea Registry
|
- name: Login to Gitea Registry
|
||||||
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login gitea.anvil.it.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login gitea.anvil.it.com -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
@@ -46,27 +20,25 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
IMAGE=gitea.anvil.it.com/kaffa/haproxy-mcp
|
IMAGE=gitea.anvil.it.com/kaffa/haproxy-mcp
|
||||||
TAG=${GITHUB_SHA::8}
|
TAG=${GITHUB_SHA::8}
|
||||||
docker buildx build \
|
docker build \
|
||||||
--platform linux/amd64 \
|
|
||||||
--tag ${IMAGE}:${TAG} \
|
--tag ${IMAGE}:${TAG} \
|
||||||
--tag ${IMAGE}:latest \
|
--tag ${IMAGE}:latest \
|
||||||
--push \
|
|
||||||
.
|
.
|
||||||
|
docker push ${IMAGE}:${TAG}
|
||||||
|
docker push ${IMAGE}:latest
|
||||||
|
|
||||||
- name: Deploy to K8s
|
- name: Deploy to K8s
|
||||||
env:
|
|
||||||
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG }}
|
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.kube
|
mkdir -p ~/.kube
|
||||||
echo "${KUBECONFIG_DATA}" | base64 -d > ~/.kube/config
|
echo "${{ secrets.KUBECONFIG }}" | base64 -d > ~/.kube/config
|
||||||
chmod 600 ~/.kube/config
|
chmod 600 ~/.kube/config
|
||||||
|
|
||||||
IMAGE=gitea.anvil.it.com/kaffa/haproxy-mcp
|
IMAGE=gitea.anvil.it.com/kaffa/haproxy-mcp
|
||||||
TAG=${GITHUB_SHA::8}
|
TAG=${GITHUB_SHA::8}
|
||||||
|
|
||||||
|
kubectl apply -f k8s/
|
||||||
kubectl set image deployment/haproxy-mcp \
|
kubectl set image deployment/haproxy-mcp \
|
||||||
haproxy-mcp=${IMAGE}:${TAG} \
|
haproxy-mcp=${IMAGE}:${TAG} \
|
||||||
-n default
|
-n default
|
||||||
|
|
||||||
kubectl rollout status deployment/haproxy-mcp \
|
kubectl rollout status deployment/haproxy-mcp \
|
||||||
-n default --timeout=120s
|
-n default --timeout=120s
|
||||||
|
|||||||
Reference in New Issue
Block a user