From 8a821754495471fb143b93816a98f478280a444f Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 3 Feb 2026 07:29:06 +0100 Subject: [PATCH 1/3] fix: use reuseable workflows for deployer --- .../deployments/deployment-with-deployer.md | 86 ++++++++----------- 1 file changed, 38 insertions(+), 48 deletions(-) diff --git a/guides/hosting/installation-updates/deployments/deployment-with-deployer.md b/guides/hosting/installation-updates/deployments/deployment-with-deployer.md index 758d7ebbd..3302e4e95 100644 --- a/guides/hosting/installation-updates/deployments/deployment-with-deployer.md +++ b/guides/hosting/installation-updates/deployments/deployment-with-deployer.md @@ -216,73 +216,63 @@ It will be used in the above-mentioned GitLab CI/CD pipeline or GitHub Actions. Have a look at the following files. All steps are provided with helpful comments. +The GitHub Action used above is [shopware/github-actions/project-deployer](https://github.com/shopware/github-actions/tree/main/project-deployer), and the GitLab CI component is [shopware/ci-components/project-deployer](https://gitlab.com/shopware/ci-components/project-deployer). + ### .gitlab-ci.yml ```yaml -# This file defines the GitLab CI/CD pipeline. -# For more information, please visit the GitLab CI/CD docs: https://docs.gitlab.com/ee/ci/README.html -variables: - GIT_STRATEGY: clone - -# This variable holds all commands that are needed to be able to connect to the target server via SSH. -# For this you need to define two variables in the GitLab CI/CD variables: -# - SSH_PRIVATE_KEY: The contents of the SSH private key file. The public key must be authorized on the target server. -# - DEPLOYMENT_SERVER: Just the hostname of the target server (e.g. shopware.com, don't include schema or paths) -.configureSSHAgent: &configureSSHAgent |- - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - mkdir -p ~/.ssh - ssh-keyscan $DEPLOYMENT_SERVER >> ~/.ssh/known_hosts - chmod 700 ~/.ssh - -Deploy: - stage: deploy - # Tags are useful to only use runners that are safe or meet specific requirements - image: - name: ghcr.io/shopware/shopware-cli:latest - entrypoint: [ "/bin/sh", "-c" ] - before_script: - # First, we need to execute all commands that are defined in the `configureSSHAgent` variable. - - *configureSSHAgent - script: - # This command installs all dependencies and builds the project. - - shopware-cli project ci . - # This command starts the workflow that is defined in the `deploy` task in the `deploy.php`. - # `production` is the stage that was defined in the `host` in the `deploy.php` - - vendor/bin/dep deploy +stages: + - check + - deploy + +include: + - component: gitlab.com/shopware/ci-components/project-validate@main + inputs: + php_version: "8.4" + - component: gitlab.com/shopware/ci-components/project-deploy@main + inputs: + php_version: "8.4" ``` -### .github/workflows/deploy.yml +### .github/workflows/check.yml ```yaml -name: Deployment +name: Check + on: push: - branches: main + branches: [ main ] + pull_request: + branches: [ main ] jobs: - deploy: + check: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 + steps: + - name: Project Validate + uses: shopware/github-actions/project-validate@main with: - php-version: '8.3' + phpVersion: '8.4' +``` + +### .github/workflows/deploy.yml - - name: Install Shopware CLI - uses: shopware/shopware-cli-action@v1 +```yaml +name: Deployment - - name: Build - run: shopware-cli project ci . +on: + workflow_dispatch: +jobs: + deploy: + runs-on: ubuntu-latest + + steps: - name: Deploy - uses: deployphp/action@v1 + uses: shopware/github-actions/project-deployer@main with: - dep: deploy - private-key: ${{ secrets.SSH_PRIVATE_KEY }} + sshPrivateKey: ${{ secrets.SSH_PRIVATE_KEY }} ``` ### deploy.php From 50dc992411f2aba23e5aece89d07258b56dcd913 Mon Sep 17 00:00:00 2001 From: Shyim Date: Tue, 3 Feb 2026 07:31:15 +0100 Subject: [PATCH 2/3] Update deployment configurations and remove checks Removed GitHub Actions check workflow and updated GitLab CI configuration. --- .../deployments/deployment-with-deployer.md | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/guides/hosting/installation-updates/deployments/deployment-with-deployer.md b/guides/hosting/installation-updates/deployments/deployment-with-deployer.md index 3302e4e95..446652174 100644 --- a/guides/hosting/installation-updates/deployments/deployment-with-deployer.md +++ b/guides/hosting/installation-updates/deployments/deployment-with-deployer.md @@ -222,39 +222,14 @@ The GitHub Action used above is [shopware/github-actions/project-deployer](https ```yaml stages: - - check - deploy include: - - component: gitlab.com/shopware/ci-components/project-validate@main - inputs: - php_version: "8.4" - - component: gitlab.com/shopware/ci-components/project-deploy@main + - component: gitlab.com/shopware/ci-components/project-deployer@main inputs: php_version: "8.4" ``` -### .github/workflows/check.yml - -```yaml -name: Check - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - check: - runs-on: ubuntu-latest - - steps: - - name: Project Validate - uses: shopware/github-actions/project-validate@main - with: - phpVersion: '8.4' -``` ### .github/workflows/deploy.yml From 0973de3d8a9d3d271c42297e9c3035339d2b0c72 Mon Sep 17 00:00:00 2001 From: Soner Sayakci Date: Tue, 3 Feb 2026 08:07:31 +0100 Subject: [PATCH 3/3] fix: remove duplicate line --- .../installation-updates/deployments/deployment-with-deployer.md | 1 - 1 file changed, 1 deletion(-) diff --git a/guides/hosting/installation-updates/deployments/deployment-with-deployer.md b/guides/hosting/installation-updates/deployments/deployment-with-deployer.md index 446652174..049a1c742 100644 --- a/guides/hosting/installation-updates/deployments/deployment-with-deployer.md +++ b/guides/hosting/installation-updates/deployments/deployment-with-deployer.md @@ -230,7 +230,6 @@ include: php_version: "8.4" ``` - ### .github/workflows/deploy.yml ```yaml