ci: 修改为手动触发Actions,默认关闭自动部署

This commit is contained in:
Cassianvale
2025-03-07 17:48:56 +08:00
parent 5f3e3de368
commit d545c94d66

View File

@@ -1,17 +1,12 @@
name: Docker Build and Deploy name: Docker Build and Deploy
on: on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'docs/**'
workflow_dispatch: workflow_dispatch:
inputs: inputs:
deploy: deploy:
description: '是否部署' description: '是否部署'
type: boolean type: boolean
default: true default: false
env: env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -83,9 +78,7 @@ jobs:
needs: [prepare, build] needs: [prepare, build]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: | if: |
success() && success() && inputs.deploy
(github.ref == 'refs/heads/main' && github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch' && inputs.deploy)
steps: steps:
- name: Checkout code for prod compose file - name: Checkout code for prod compose file