Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions project-deployer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Project Deployer

This GitHub Action builds and deploys a Shopware project using shopware-cli and deployer.

## What it does

1. Checks out your repository (optional)
2. Sets up PHP with the specified version
3. Installs Shopware CLI
4. Builds the project using `shopware-cli project ci`
5. Deploys using deployphp/action

## Inputs

| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `phpVersion` | PHP version to use | No | `8.4` |
| `sshPrivateKey` | SSH private key for deployment (use `secrets.SSH_PRIVATE_KEY`) | Yes | - |
| `deployCommand` | Deploy command to run | No | `deploy` |
| `path` | Path to the project | No | `.` |
| `skipCheckout` | Skip the checkout step | No | `false` |

## Usage

### Basic usage

```yaml
name: Deploy

on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: shopware/github-actions/project-deployer@main
with:
sshPrivateKey: ${{ secrets.SSH_PRIVATE_KEY }}
```

### With custom PHP version and path

```yaml
- uses: shopware/github-actions/project-deployer@main
with:
phpVersion: '8.3'
path: './shopware'
sshPrivateKey: ${{ secrets.SSH_PRIVATE_KEY }}
deployCommand: 'deploy production'
```

### Skip checkout (if already checked out)

```yaml
- uses: actions/checkout@v6
- uses: shopware/github-actions/project-deployer@main
with:
skipCheckout: 'true'
sshPrivateKey: ${{ secrets.SSH_PRIVATE_KEY }}
```

## Requirements

- SSH private key must be stored as a repository secret named `SSH_PRIVATE_KEY`
- Your project must have a deployer configuration file (deploy.php)
52 changes: 52 additions & 0 deletions project-deployer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Project Deployer"
description: "Builds and deploys a Shopware project using shopware-cli and deployer"
author: "shopware AG"
branding:
color: "blue"
icon: "upload"

inputs:
phpVersion:
description: "PHP version to use"
required: false
default: "8.4"
sshPrivateKey:
description: "SSH private key for deployment (use secrets.SSH_PRIVATE_KEY)"
required: true
deployCommand:
description: "Deploy command to run"
required: false
default: "deploy"
path:
description: "Path to the project"
required: false
default: "."
skipCheckout:
description: "Skip the checkout step"
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Checkout
if: inputs.skipCheckout != 'true'
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.phpVersion }}

- name: Install Shopware CLI
uses: shopware/shopware-cli-action@v3

- name: Build
shell: bash
run: shopware-cli project ci ${{ inputs.path }}

- name: Deploy
uses: deployphp/action@v1
with:
dep: ${{ inputs.deployCommand }}
private-key: ${{ inputs.sshPrivateKey }}
70 changes: 70 additions & 0 deletions project-validate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Project Validate

This GitHub Action validates a Shopware project code style and structure.

## What it does

1. Checks out your repository (optional)
2. Sets up PHP with the specified version
3. Installs Shopware CLI
4. Installs composer dependencies
5. Validates the project structure using `shopware-cli project validate`
6. Checks code style using `shopware-cli project format --dry-run`

## Inputs

| Input | Description | Required | Default |
|-------|-------------|----------|---------|
| `phpVersion` | PHP version to use | No | `8.4` |
| `path` | Path to the project | No | `.` |
| `skipCheckout` | Skip the checkout step | No | `false` |

## Usage

### Basic usage

```yaml
name: Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: shopware/github-actions/project-validate@main
```

### With custom PHP version

```yaml
- uses: shopware/github-actions/project-validate@main
with:
phpVersion: '8.3'
```

### With custom path

```yaml
- uses: shopware/github-actions/project-validate@main
with:
path: './shopware'
```

### Skip checkout (if already checked out)

```yaml
- uses: actions/checkout@v6
- uses: shopware/github-actions/project-validate@main
with:
skipCheckout: 'true'
```

## Requirements

- Your project must have a `composer.json` file
- The project should follow Shopware project structure
46 changes: 46 additions & 0 deletions project-validate/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Project Validate"
description: "Validates a Shopware project code style and structure"
author: "shopware AG"
branding:
color: "blue"
icon: "check-circle"

inputs:
phpVersion:
description: "PHP version to use"
required: false
default: "8.4"
path:
description: "Path to the project"
required: false
default: "."
skipCheckout:
description: "Skip the checkout step"
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Checkout
if: inputs.skipCheckout != 'true'
uses: actions/checkout@v6

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.phpVersion }}

- name: Install Shopware CLI
uses: shopware/shopware-cli-action@v3

- name: Install dependencies
uses: ramsey/composer-install@v3

- name: Validate Project
shell: bash
run: shopware-cli project validate ${{ inputs.path }}

- name: Check Code Style
shell: bash
run: shopware-cli project format --dry-run ${{ inputs.path }}