run deploy #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - tobias/create-github-actions-for-deployment | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: 'Branch to deploy' | |
| required: true | |
| default: 'main' | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy-test: | |
| name: Deploy to test environment | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Deploy to test server | |
| uses: appleboy/[email protected] | |
| with: | |
| key: ${{ secrets.SSH_KEY }} | |
| username: voko_acc | |
| host: leden.vokoutrecht.nl | |
| script: | | |
| # Run the deploy script with the specified branch | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| # Auto-deploy to test environment on push to main | |
| $HOME/scripts/deploy.sh -b 'tobias/create-github-actions-for-deployment' | |
| else | |
| # Manual deploy with specified branch | |
| $HOME/scripts/deploy.sh -b ${{ github.event.inputs.branch }} | |
| fi | |
| # deploy-production: | |
| # name: Deploy to production environment | |
| # runs-on: ubuntu-latest | |
| # environment: production | |
| # if: github.event_name == 'push' | |
| # steps: | |
| # - name: Deploy to production server | |
| # uses: appleboy/[email protected] | |
| # with: | |
| # key: ${{ secrets.SSH_KEY }} | |
| # script: | | |
| # # Run the deploy script with the specified branch | |
| # $HOME/scripts/deploy.sh -b ${{ github.event.inputs.branch }} |