You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/bare_metal_cloud/virtual_private_servers/deploy-website-github-actions/guide.en-gb.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: "Automating the deployment of your website on your OVHcloud VPS via GitHub Actions"
2
+
title: "Automating the deployment of your website on your VPS via GitHub Actions"
3
3
excerpt: 'Find out how to deploy and automate your website’s code via GitHub Actions on an OVHcloud VPS'
4
4
updated: 2025-01-21
5
5
---
6
6
7
7
## Objective
8
8
9
-
Automating the deployment of your website on a VPS greatly simplifies the management of your updates. With GitHub Actions, you can configure an automatic deployment pipeline, avoiding manual deployments. This method ensures fast and reliable deployment, while reducing the risk of human error. Whether you are a beginner or an experienced developer, this tutorial will help you set up a professional solution adapted to your needs.
9
+
Automating the deployment of your website on a VPS greatly simplifies the management of your updates. With GitHub Actions, you can configure an automatic deployment pipeline, avoiding manual deployments. This method ensures fast and reliable deployments, while reducing the risk of human errors. Whether you are a beginner or an experienced developer, this tutorial will help you set up a professional solution adapted to your needs.
10
10
11
11
**Find out how to automate the deployment of your web applications with GitHub Actions on an OVHcloud VPS.**
12
12
@@ -25,20 +25,20 @@ Automating the deployment of your website on a VPS greatly simplifies the manage
25
25
## Instructions
26
26
27
27
> [!primary]
28
-
> To ensure that you meet the requirements, please read the guides “[Installing a web development environment on a VPS or a dedicated server](/pages/bare_metal_cloud/virtual_private_servers/install_env_web_dev_on_vps)” and “[Securing a VPS](/pages/bare_metal_cloud/virtual_private_servers/secure_your_vps)”.
28
+
> To ensure that you meet the requirements, please read the guides [Installing a web development environment on a VPS or a dedicated server](/pages/bare_metal_cloud/virtual_private_servers/install_env_web_dev_on_vps) and [Securing a VPS](/pages/bare_metal_cloud/virtual_private_servers/secure_your_vps).
29
29
30
-
## Contents
30
+
**The main steps of the guide will be the following:**
31
31
32
32
-[Configure SSH access for GitHub Actions](#configure-ssh)
33
-
-[Add private key to GitHub](#add-private-key-github)
-[Add the private key to GitHub](#add-private-key-github)
34
+
-[Initialize the GitHub repository (optional)](#init-github-repo)
35
35
-[Configure GitHub Actions for Automatic Deployment](#configure-github-actions)
36
36
-[Check and test the GitHub Actions workflow](#verify-workflow-github)
37
37
-[Conclusion](#conclusion)
38
38
39
39
### Configure SSH access for GitHub Actions <aname="configure-ssh"></a>
40
40
41
-
If your website already exists, identify the path to the directory where it is hosted. For example, on an OVHcloud VPS, it can be `/var/www/html`. Keep this path to use when configuring the Actions GitHub pipeline.
41
+
If your website already exists, identify the path to the directory where it is hosted. For example, on an OVHcloud VPS, it can be `/var/www/html`. Keep this path in memory, so that you can use it when configuring the GitHub Actions pipeline.
42
42
43
43
To allow GitHub Actions to automatically deploy your website, configure secure SSH access to your VPS.
Replace `<user>` with the user configured to connect to your VPS.
54
54
55
-
Press `Enter` when a passphrase is requested (leaving the passphrase empty makes it easier to automate deployment with GitHub Actions. However, this requires securing the private key by limiting it to this use and storing it securely).
55
+
Press `Enter` when a passphrase is requested (leaving the passphrase empty makes it easier to automate deployments with GitHub Actions. However, this requires securing the private key by limiting it to this use and storing it securely).
56
56
57
57
You get two files:
58
58
@@ -63,14 +63,14 @@ You get two files:
63
63
64
64
To allow GitHub Actions to connect to your VPS via SSH and deploy your website’s code to it, add the generated public key to the list of authorized keys on the VPS.
65
65
66
-
1\. Create `.ssh` directory:
66
+
1\. Create the `.ssh` directory:
67
67
68
68
```bash
69
69
mkdir -p /home/<user>/.ssh
70
70
chmod 700 /home/<user>/.ssh
71
71
```
72
72
73
-
2\. Add public key to `authorized_keys` file:
73
+
2\. Add the public key to the`authorized_keys` file:
@@ -95,7 +95,7 @@ Once you have configured the public key on your VPS, add it to your GitHub accou
95
95
cat /home/<user>/.ssh/deploy_key.pub
96
96
```
97
97
98
-
Follow the steps in the “Adding a new SSH key to your account” section of [GitHub official documentation](https://docs.github.com/gb/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account#adding-a-new-ssh-key-to-your-account) to add your public key to your GitHub account.
98
+
Follow the steps from the "Adding a new SSH key to your account" section of the[GitHub official documentation](https://docs.github.com/gb/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account#adding-a-new-ssh-key-to-your-account) to add your public key to your GitHub account.
99
99
100
100
#### Configure SSH access to GitHub on the VPS
101
101
@@ -130,15 +130,15 @@ You should see a message like this:
130
130
Hi <user-github>! You've successfully authenticated, but GitHub does not provide shell access.
131
131
```
132
132
133
-
### Add private key to GitHub <aname="add-private-key-github"></a>
133
+
### Add the private key to GitHub <aname="add-private-key-github"></a>
134
134
135
135
Copy the content of the generated private key to your VPS with:
136
136
137
137
```bash
138
138
cat /home/<user>/.ssh/deploy_key
139
139
```
140
140
141
-
To allow GitHub Actions to automatically connect to your VPS, add the private key in a secret repository on GitHub. This will allow GitHub to deploy your website via SSH. Follow the steps in the “Creating secrets for a repository” section of the [GitHub official documentation](https://docs.github.com/gb/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository).
141
+
To allow GitHub Actions to automatically connect to your VPS, add the private key in a secret repository on GitHub. This will allow GitHub to deploy your website via SSH. Follow the steps from the "Creating secrets for a repository" section of the [GitHub official documentation](https://docs.github.com/gb/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository).
@@ -147,9 +147,9 @@ To allow GitHub Actions to automatically connect to your VPS, add the private ke
147
147
148
148
#### Create a GitHub repository
149
149
150
-
To create a GitHub repository, follow the steps on the Create a repository page in the [GitHub official documentation](https://docs.github.com/gb/en/repositories/creating-and-managing-repositories/creating-a-new-repository){.external}.
150
+
To create a GitHub repository, follow the steps from the "Create a repository" page of the [GitHub official documentation](https://docs.github.com/gb/en/repositories/creating-and-managing-repositories/creating-a-new-repository){.external}.
151
151
152
-
#### Initialize upload on the VPS
152
+
#### Initialize the Git repository on the VPS
153
153
154
154
1\. Log in to your VPS via SSH:
155
155
@@ -205,7 +205,7 @@ Create a `deploy.yml` file in the `.github/workflows` directory:
205
205
nano .github/workflows/deploy.yml
206
206
```
207
207
208
-
3\. Configure the `deploy.yml` file.
208
+
3\. Configure the `deploy.yml` file
209
209
210
210
To configure the deployment pipeline, add the following content to the `deploy.yml` file:
If this command succeeds, then restart the workflow on GitHub.
285
285
286
-
#### Workflow triggered with `git push`
286
+
#### Trigger the Workflow with `git push`
287
287
288
288
When a `git push` is performed on the `main` branch (or any other branch specified in your `deploy.yml` file), the workflow executes the steps defined in the `deploy.yml` file:
289
289
290
290
- Cloning the GitHub repository in the GitHub Actions environment.
291
291
- Configuring the SSH key to connect to your VPS.
292
-
- Synchronize files from the GitHub repository to the directory `/var/www/html' on your VPS via `rsync'.
292
+
- Synchronize files from the GitHub repository to the directory `/var/www/html` on your VPS via `rsync`.
Add a new file or modify an existing file in the test directory and push a git to your GitHub repository:
319
+
Add a new file or modify an existing file in the test directory and perform a `git push` to your GitHub repository:
320
320
321
321
```bash
322
322
echo "Test from VPS user number 2" >> testfile.txt
@@ -325,7 +325,7 @@ git commit -m "Add a test from the VPS"
325
325
git push origin main
326
326
```
327
327
328
-
4\. Check workflow execution on GitHub
328
+
4\. Check the workflow execution on GitHub
329
329
330
330
Go to the `Actions` tab of your GitHub repository and check that the workflow was triggered automatically after the `git push`. If the workflow is successful, the changes will be synchronized in your website’s folder (`/var/www/html`).
331
331
@@ -346,7 +346,7 @@ By following this guide, you have set up an automatic deployment pipeline from y
346
346
347
347
[Getting started with a VPS](/pages/bare_metal_cloud/virtual_private_servers/starting_with_a_vps)
348
348
349
-
[Secure a VPS](/pages/bare_metal_cloud/virtual_private_servers/secure_your_vps)
349
+
[Securing a VPS](/pages/bare_metal_cloud/virtual_private_servers/secure_your_vps)
350
350
351
351
For specialized services (SEO, development, etc.), contact the [OVHcloud partners](/links/partner).
Copy file name to clipboardExpand all lines: pages/bare_metal_cloud/virtual_private_servers/deploy-website-github-actions/guide.fr-fr.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "Automatiser le déploiement de votre site web sur votre VPS OVHcloud via GitHub Actions"
2
+
title: "Automatiser le déploiement de votre site web sur votre VPS via GitHub Actions"
3
3
excerpt: 'Découvrez comment déployer et automatiser le code de votre site web via GitHub Actions sur un VPS OVHcloud'
4
4
updated: 2025-01-21
5
5
---
@@ -27,7 +27,7 @@ Automatiser le déploiement de votre site web sur un VPS simplifie considérable
27
27
> [!primary]
28
28
> Afin d'être sûr de remplir les prérequis, consultez les guides « [Installer un environnement de développement web sur un VPS ou un serveur dédié](/pages/bare_metal_cloud/virtual_private_servers/install_env_web_dev_on_vps) » et « [Sécuriser un VPS](/pages/bare_metal_cloud/virtual_private_servers/secure_your_vps) ».
29
29
30
-
## Sommaire
30
+
**Les étapes principales du guide seront les suivantes :**
31
31
32
32
-[Configurer l'accès SSH pour GitHub Actions](#configure-ssh)
33
33
-[Ajouter la clé privée à GitHub](#add-private-key-github)
@@ -38,7 +38,7 @@ Automatiser le déploiement de votre site web sur un VPS simplifie considérable
38
38
39
39
### Configurer l'accès SSH pour GitHub Actions <aname="configure-ssh"></a>
40
40
41
-
Si votre site web existe déjà, identifiez le chemin du répertoire où il est hébergé. Par exemple, sur un VPS OVHcloud, il peut s'agir de `/var/www/html`. Conservez ce chemin pour l'utiliser lors de la configuration du pipeline GitHub Actions.
41
+
Si votre site web existe déjà, identifiez le chemin du répertoire où il est hébergé. Par exemple, sur un VPS OVHcloud, il peut s'agir de `/var/www/html`. Conservez ce chemin en mémoire, afin de l'utiliser lors de la configuration du pipeline GitHub Actions.
42
42
43
43
Pour permettre à GitHub Actions de déployer automatiquement votre site web, configurez un accès SSH sécurisé à votre VPS.
44
44
@@ -149,7 +149,7 @@ Pour permettre à GitHub Actions de se connecter automatiquement à votre VPS, a
149
149
150
150
Pour créer un dépôt GitHub, suivez les étapes de la page « Création d'un dépôt » de la [documentation officielle de GitHub](https://docs.github.com/fr/repositories/creating-and-managing-repositories/creating-a-new-repository){.external}.
Copy file name to clipboardExpand all lines: pages/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -268,7 +268,7 @@
268
268
+[How to install WordPress with Docker on a VPS or a dedicated server](bare_metal_cloud/virtual_private_servers/install_wordpress_docker_on_vps)
269
269
+[How to install WordPress with WP-CLI on a VPS or a dedicated server](bare_metal_cloud/virtual_private_servers/install_wordpress_site_on_vps)
270
270
+[How to migrate a website from a VPS to a Dedicated Server or a Public Cloud instance](bare_metal_cloud/virtual_private_servers/migrate-to-pci-or-dedicated-server)
271
-
+[Automating the deployment of your website on your OVHcloud VPS via GitHub Actions](bare_metal_cloud/virtual_private_servers/deploy-website-github-actions)
271
+
+[Automating the deployment of your website on your VPS via GitHub Actions](bare_metal_cloud/virtual_private_servers/deploy-website-github-actions)
272
272
+[Managed Bare Metal](products/bare-metal-cloud-managed-bare-metal)
273
273
+[OVHcloud services and options](bare-metal-cloud-managed-bare-metal-ovhcloud-services-and-options)
274
274
+ [Setting up a VPN for OVHcloud Zerto DRP](bare_metal_cloud/managed_bare_metal/zerto-virtual-replication-customer-to-ovhcloud)
0 commit comments