diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index fc50835d9..32ff5ec73 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,12 +25,16 @@ on: required: false default: "" type: string + push: + branches: + - main jobs: deploy: - name: Deploy to ${{ inputs.target_environment }} + # Use different logic based on event type + name: Deploy to ${{ github.event_name == 'workflow_dispatch' && inputs.target_environment || 'staging' }} runs-on: ubuntu-latest - environment: ${{ inputs.target_environment }} + environment: ${{ github.event_name == 'workflow_dispatch' && inputs.target_environment || 'staging' }} steps: - uses: actions/checkout@v4 @@ -44,7 +48,13 @@ jobs: echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan -H ${{ secrets.SERVER_HOST_STAGING }} >> ~/.ssh/known_hosts - cat >.env.${{ inputs.target_environment }} <.env.$TARGET_ENV <