Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -216,73 +216,37 @@

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:
- deploy

include:
- component: gitlab.com/shopware/ci-components/project-deployer@main

Check warning on line 228 in guides/hosting/installation-updates/deployments/deployment-with-deployer.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/hosting/installation-updates/deployments/deployment-with-deployer.md#L228

The official name of this software platform is spelled with a capital “H”. (GITHUB[1]) Suggestions: `GitHub` URL: https://en.wikipedia.org/wiki/GitHub Rule: https://community.languagetool.org/rule/show/GITHUB?lang=en-US&subId=1 Category: CASING
Raw output
guides/hosting/installation-updates/deployments/deployment-with-deployer.md:228:44: The official name of this software platform is spelled with a capital “H”. (GITHUB[1])
 Suggestions: `GitHub`
 URL: https://en.wikipedia.org/wiki/GitHub 
 Rule: https://community.languagetool.org/rule/show/GITHUB?lang=en-US&subId=1
 Category: CASING
inputs:
php_version: "8.4"
```

### .github/workflows/deploy.yml

```yaml
name: Deployment

on:
push:
branches: main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

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

- name: Build
run: shopware-cli project ci .

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 }}

Check warning on line 249 in guides/hosting/installation-updates/deployments/deployment-with-deployer.md

View workflow job for this annotation

GitHub Actions / LanguageTool

[LanguageTool] guides/hosting/installation-updates/deployments/deployment-with-deployer.md#L249

File types are normally capitalized. (FILE_EXTENSIONS_CASE[1]) Suggestions: `PHP` URL: https://languagetool.org/insights/post/spelling-capital-letters/ Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1 Category: CASING
Raw output
guides/hosting/installation-updates/deployments/deployment-with-deployer.md:249:6: File types are normally capitalized. (FILE_EXTENSIONS_CASE[1])
 Suggestions: `PHP`
 URL: https://languagetool.org/insights/post/spelling-capital-letters/ 
 Rule: https://community.languagetool.org/rule/show/FILE_EXTENSIONS_CASE?lang=en-US&subId=1
 Category: CASING
```

### deploy.php
Expand Down