From 62df42d4792d3d45ab9f2629a41b3214a6ea665a Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 5 Jul 2026 19:57:43 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=A0=E9=99=A4=20GitHub=20Actions?= =?UTF-8?q?=20=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=8C=E4=BD=BF=E7=94=A8=20Git?= =?UTF-8?q?ea=20Actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker.yml | 53 ------------------------------------ 1 file changed, 53 deletions(-) delete mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index cc800be..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build and Push Docker Image - -on: - push: - branches: [main] - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: cmakecpp/sale - -jobs: - build-and-push: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push image - uses: docker/build-push-action@v5 - with: - context: . - file: ./backend/Dockerfile - push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - no-cache: true - - - name: Deploy to server via SSH - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USER }} - password: ${{ secrets.SERVER_PASSWORD }} - port: 22 - script: | - docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - docker stop sale-app || true - docker rm sale-app || true - docker run -d --name sale-app -p 8080:8080 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest