Skip to content

Commit

Permalink
Update static-deploy.md
Browse files Browse the repository at this point in the history
The previous .gitlab-ci.yml configuration was not functioning as expected in real-world scenarios. This PR introduces a revised version based on a configuration that has been tested and proven to work in practice.

It simplifies the pipeline, improves reliability, and resolves issues encountered with the earlier setup.
  • Loading branch information
vadim4web authored Jan 27, 2025
1 parent a4245b0 commit 0b5b33d
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions docs/guide/static-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,24 @@ Now the `preview` command will launch the server at `http://localhost:8080`.
2. 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 [.gitlab-ci.yml]
image: node:16.5.0
pages:
stage: deploy
cache:
key:
files:
- package-lock.json
prefix: npm
paths:
- node_modules/
script:
- npm install
- npm run build
- cp -a dist/. public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image: node:18.16.0
pages:
stage: deploy
cache:
key: npm-cache
paths:
- node_modules/
script:
- npm install
- npm run build
- mkdir -p public
- cp -r dist/* public
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
```

## Netlify
Expand Down

0 comments on commit 0b5b33d

Please sign in to comment.