forked from innovacion/searchbox
66 lines
2.0 KiB
YAML
66 lines
2.0 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
ci:
|
|
uses: ./.github/workflows/ci.yaml
|
|
|
|
push:
|
|
needs: ci
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.ia-innovacion.work
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gitea.ia-innovacion.work/innovacion/searchbox-mcp
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=ref,event=tag,suffix=-{{sha}}
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
deploy:
|
|
needs: push
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install kubectl
|
|
uses: azure/setup-kubectl@v3
|
|
|
|
- name: Deploy to cluster
|
|
env:
|
|
KUBECONFIG_CONTENT: ${{ secrets.KUBECONFIG_CONTENT }}
|
|
run: |
|
|
echo "$KUBECONFIG_CONTENT" > kubeconfig
|
|
export KUBECONFIG=$PWD/kubeconfig
|
|
kubectl apply -f .k8s/
|
|
kubectl rollout restart deployment/searchbox-mcp
|
|
kubectl rollout status deployment/searchbox-mcp
|