From aa4153b2cc3c00b88c3dc252a4b032e5f3db1bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Bo=C5=BEi=C4=8D?= Date: Mon, 6 Nov 2023 09:36:28 +0100 Subject: [PATCH 1/2] Update gitlab.mdx .gitlab-ci.yml example This commit addresses a syntax error in the .gitlab-ci.yml file that was causing the pipeline to fail. The error was due to incorrect indentation in the YAML file. Additionally, the `before_script` block, which was previously defined globally, has been moved inside the `pages` job. This change provides better flexibility for users who have multiple stages in their pipelines, as the `before_script` will now only run before the `pages` job, rather than before every job in the pipeline. These changes should resolve the pipeline failure and prevent potential issues in multi-stage pipelines. --- src/content/docs/en/guides/deploy/gitlab.mdx | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/content/docs/en/guides/deploy/gitlab.mdx b/src/content/docs/en/guides/deploy/gitlab.mdx index 4a6ed0193cd78..1b24854819cd2 100644 --- a/src/content/docs/en/guides/deploy/gitlab.mdx +++ b/src/content/docs/en/guides/deploy/gitlab.mdx @@ -34,26 +34,26 @@ Check out [the official GitLab Pages Astro example project](https://gitlab.com/p 4. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content: - ```yaml - # The Docker image that will be used to build your app - image: node:lts - + ```yaml + # The Docker image that will be used to build your app + image: node:lts + + pages: before_script: - npm ci - pages: - script: - # Specify the steps involved to build your app here - - npm run build - - artifacts: - paths: - # The folder that contains the built files to be published. - # This must be called "public". - - public - - only: - # Trigger a new build and deploy only when there is a push to the - # branch(es) below - - main - ``` + script: + # Specify the steps involved to build your app here + - npm run build + + artifacts: + paths: + # The folder that contains the built files to be published. + # This must be called "public". + - public + + only: + # Trigger a new build and deploy only when there is a push to the + # branch(es) below + - main + ``` From 5b8cd3cb6f95ad2a9bffafb835ade1d3af86c902 Mon Sep 17 00:00:00 2001 From: Benjamin Bozic Date: Tue, 7 Nov 2023 10:19:07 +0100 Subject: [PATCH 2/2] Update gitlab.mdx pipeline example - consolidation and code block indent fix In previus commit the whole code block with pipeline example was moved. This commit fixes the indentation issue and also moves image inside pages for better reusability. --- src/content/docs/en/guides/deploy/gitlab.mdx | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/content/docs/en/guides/deploy/gitlab.mdx b/src/content/docs/en/guides/deploy/gitlab.mdx index 1b24854819cd2..b9147410bb329 100644 --- a/src/content/docs/en/guides/deploy/gitlab.mdx +++ b/src/content/docs/en/guides/deploy/gitlab.mdx @@ -34,26 +34,26 @@ Check out [the official GitLab Pages Astro example project](https://gitlab.com/p 4. Create a file called `.gitlab-ci.yml` in the root of your project with the content below. This will build and deploy your site whenever you make changes to your content: - ```yaml - # The Docker image that will be used to build your app - image: node:lts - - pages: - before_script: - - npm ci - - script: - # Specify the steps involved to build your app here - - npm run build - - artifacts: - paths: - # The folder that contains the built files to be published. - # This must be called "public". - - public - - only: - # Trigger a new build and deploy only when there is a push to the - # branch(es) below - - main - ``` + ```yaml + pages: + # The Docker image that will be used to build your app + image: node:lts + + before_script: + - npm ci + + script: + # Specify the steps involved to build your app here + - npm run build + + artifacts: + paths: + # The folder that contains the built files to be published. + # This must be called "public". + - public + + only: + # Trigger a new build and deploy only when there is a push to the + # branch(es) below + - main + ```