rtc_web/.gitea/workflows/deploy.yaml
zyc ce11450971
Some checks failed
Build and Deploy Web / build-and-deploy (push) Failing after 47s
fix build
2026-01-29 11:43:49 +08:00

51 lines
1.4 KiB
YAML

name: Build and Deploy Web
on:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config-inline: |
[registry."docker.io"]
mirrors = ["https://docker.m.daocloud.io", "https://docker.1panel.live", "https://hub.rat.dev"]
- name: Login to Huawei Cloud SWR
uses: docker/login-action@v2
with:
registry: ${{ secrets.SWR_SERVER }}
username: ${{ secrets.SWR_USERNAME }}
password: ${{ secrets.SWR_PASSWORD }}
- name: Build and Push Web
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ secrets.SWR_SERVER }}/${{ secrets.SWR_ORG }}/rtc-web:latest
- name: Deploy to K3s
uses: Azure/k8s-set-context@v3
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBE_CONFIG }}
- name: Update K8s Manifests
run: |
sed -i "s|\${CI_REGISTRY_IMAGE}/web:latest|${{ secrets.SWR_SERVER }}/${{ secrets.SWR_ORG }}/rtc-web:latest|g" k8s/web-deployment.yaml
kubectl apply -f k8s/web-deployment.yaml
kubectl apply -f k8s/ingress.yaml
kubectl rollout restart deployment/rtc-web