diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml deleted file mode 100644 index 65071f7..0000000 --- a/.gitea/workflows/build.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build - -on: - push: - branches: [main, develop] - pull_request: - branches: [main, develop] - -env: - DOTNET_VERSION: '10.0.103' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: ${{ env.DOTNET_VERSION }} - - - name: Cache NuGet packages - uses: actions/cache@v4 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} - restore-keys: | - ${{ runner.os }}-nuget- - - - name: Restore dependencies - run: dotnet restore src/Fengling.Console.csproj - - - name: Build - run: dotnet build src/Fengling.Console.csproj --configuration Release --no-restore - - - name: Publish - run: dotnet publish src/Fengling.Console.csproj --configuration Release --no-build -o ./publish diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml deleted file mode 100644 index 19386d8..0000000 --- a/.gitea/workflows/deploy.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Deploy to K8s - -on: - push: - branches: [main] - tags: - - "v*" - -env: - REGISTRY: gitea.shtao1.cn - IMAGE_NAME: fengling/fengling-console - KUBECONFIG: ${{ secrets.KUBECONFIG }} - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Extract version - id: version - run: | - VERSION=${{ github.ref_name }} - if [[ $VERSION == v* ]]; then - VERSION=${VERSION#v} - fi - echo "version=$VERSION" >> $GITHUB_OUTPUT - - - name: Login to Gitea - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: fengling - password: ${{ secrets.GITEATOKEN }} - - - name: Deploy to Kubernetes - uses: k8s-toolset/gitops-deploy-action@main - with: - k8s-manifest: | - apiVersion: apps/v1 - kind: Deployment - metadata: - name: fengling-console - namespace: fengling - spec: - replicas: 2 - selector: - matchLabels: - app: fengling-console - template: - metadata: - labels: - app: fengling-console - spec: - containers: - - name: fengling-console - image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} - imagePullPolicy: Always - args: | - kubectl set image deployment/fengling-console fengling-console=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} -n fengling - kubectl rollout status deployment/fengling-console -n fengling --timeout=300s