Skip to content

feat: cloud ci:setup — generate CI/CD workflow files #99

@JoshSalway

Description

@JoshSalway

Description

The CLI works in CI/CD (--no-interaction, --token, JSON output, proper exit codes) but there is no guidance on how to set it up. Users must write workflow files from scratch. Vercel and Fly generate these automatically.

What it would do

cloud ci:setup --provider github-actions
# Creates .github/workflows/cloud-deploy.yml
# Asks: Auto-deploy on push to main? (yes)
# Asks: Deploy to which environment? (production)
# Asks: Require approval for production? (no)
# 
# Created: .github/workflows/cloud-deploy.yml
# 
# Next steps:
# 1. Add LARAVEL_CLOUD_API_TOKEN as a repository secret
# 2. Push to main to trigger your first automated deployment

Generated workflow example

name: Deploy to Laravel Cloud
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: '8.4'
      - run: composer global require laravel/cloud-cli
      - run: cloud deploy --no-interaction
        env:
          LARAVEL_CLOUD_API_TOKEN: ${{ secrets.LARAVEL_CLOUD_API_TOKEN }}

Feasibility

Safe and straightforward. The command only creates a new file — never modifies existing workflows. If .github/workflows/cloud-deploy.yml already exists, it warns and exits.

Supports: github-actions, gitlab-ci, bitbucket-pipelines (could start with GitHub Actions only).

Implementation

  1. New command app/Commands/CiSetup.php with NoAuthRequired interface (doesn't need API token)
  2. Prompt for provider, branch, environment
  3. Generate YAML from template
  4. Write to correct location
  5. Show next steps

Impact

Enables 30% more users to automate deployments. Currently only developers who know how to write CI workflow files can automate — this opens it to everyone.

Builds on

Environment

  • Cloud CLI: v0.1.14

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions