Skip to content

add --env-file to runcrons.sh #10

add --env-file to runcrons.sh

add --env-file to runcrons.sh #10

Workflow file for this run

---
name: Deploy
on:
push:
branches:
- main
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 == '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 }}
username: voko
host: leden.vokoutrecht.nl
script: |
# Run the deploy script with the specified branch
$HOME/scripts/deploy_prod.sh