name: 🚀 Deploy on: workflow_dispatch: inputs: target_environment: description: "Deployment Environment" required: true default: "staging" type: choice options: - prod - staging target_host: description: "Deployment Host" required: true default: "staging" type: choice options: - eu - us - staging target_subdomain: description: "Deployment Subdomain" required: false default: "" type: string jobs: deploy: name: Deploy to ${{ inputs.target_environment }} runs-on: ubuntu-latest environment: ${{ inputs.target_environment }} steps: - uses: actions/checkout@v4 - name: Log in to Docker Hub uses: docker/login-action@v3 with: username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - run: | mkdir -p ~/.ssh 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 }} <