name: deploy (reusable) on: workflow_call: inputs: environment: type: string required: true secrets: DEPLOY_TOKEN: required: true permissions: {} jobs: deploy: runs-on: ubuntu-latest environment: ${{ inputs.environment }} steps: - name: Fail fast if the token is empty env: DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} run: | if [ -z "$DEPLOY_TOKEN" ]; then echo "::error::DEPLOY_TOKEN is empty for this environment" exit 1 fi - name: Deploy env: DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }} TARGET: ${{ inputs.environment }} run: ./scripts/deploy.sh "$TARGET"