Compare commits
2 Commits
937c54ecfb
...
118189da82
| Author | SHA1 | Date | |
|---|---|---|---|
| 118189da82 | |||
| d963ea83ad |
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
@@ -17,10 +17,13 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
dry_run:
|
||||
description: 'Dry run (deploy only — no SSH, just show what would run)'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: 'Dry run (only for deploy — no SSH, only show planned steps)'
|
||||
required: true
|
||||
type: choice
|
||||
default: no
|
||||
options:
|
||||
- no
|
||||
- yes
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
@@ -30,7 +33,7 @@ jobs:
|
||||
github.event_name == 'push' ||
|
||||
(github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'deploy')
|
||||
env:
|
||||
DRY_RUN: ${{ github.event.inputs.dry_run == 'true' }}
|
||||
DRY_RUN: ${{ github.event.inputs.dry_run == 'yes' }}
|
||||
concurrency:
|
||||
group: production-deploy-telegram-helper-bot
|
||||
cancel-in-progress: false
|
||||
@@ -44,7 +47,7 @@ jobs:
|
||||
ref: main
|
||||
|
||||
- name: Dry run (simulate deploy steps)
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true'
|
||||
if: github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'yes'
|
||||
run: |
|
||||
echo "🔍 DRY RUN — no SSH, no changes on server"
|
||||
echo "Would run on server:"
|
||||
@@ -62,7 +65,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Deploy to server
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'true'
|
||||
if: github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run != 'yes'
|
||||
uses: appleboy/ssh-action@v1.0.0
|
||||
with:
|
||||
host: ${{ vars.SERVER_HOST || secrets.SERVER_HOST }}
|
||||
|
||||
Reference in New Issue
Block a user