Skip to content

Workflow fix

Workflow fix #168

Workflow file for this run

name: Run SSH command
on:
workflow_dispatch:
pull_request:
types:
- closed
issues:
types: [labeled]
jobs:
build:
runs-on: ubuntu-latest
environment: production # Specifies the environment
steps:
- name: Run SSH command
uses: appleboy/ssh-action@master
timeout-minutes: 60
with:
command_timeout: "60m"
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: |
bash -s << 'EOF'
shopt -s expand_aliases
echo "Event: ${{ github.event_name }}"
# Handle merged pull requests
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
if [[ "${{ github.event.pull_request.merged }}" == "true" ]]; then
if [[ "${{ github.event.pull_request.base.ref }}" == "staging" ]]; then
cd /root/digitalocean_ci_cd_app_releases && ./start.sh
elif [[ "${{ github.event.pull_request.base.ref }}" == "master" ]]; then
cd /root/digitalocean_ci_cd_app_releases && ./start.sh cp && ./start.sh build
fi
else
echo "PR closed but not merged. Skipping."
exit 0
fi
fi
# Handle labeled issue events
if [[ "${{ github.event_name }}" == "issues" ]]; then
echo "Issue labeled. Running issues command."
smswithoutborders_deku_libsmsmms_issues
fi
EOF