diff --git a/README.md b/README.md index a761fd2..fef25fb 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,24 @@ cache: paths: - node_modules/ ``` + +### GitLab-CI with lftp +If I want GitLab CI/CD to deploy my website each time that I push to GitLab, I can use something called [lftp][lftp]. Here is what you can do in the `gitlab-ci.yml` configuration file. + +
+```yaml +# Using the latest ubuntu image +image: ubuntu:latest + +before_script: + - apt-get update -qy + - apt-get install -y lftp + +build: + script: + # Sync to FTP + - lftp -e "open $FTP_HOST; user $FTP_USERNAME $FTP_PASSWORD; mirror -X .* -X .*/ --reverse --verbose --delete public/ $FTP_REMOTE_PATH/; bye" + ### GitLab-CI We need to prepare our `gitlab-ci.yml` configuration file to do as we described previously. @@ -327,6 +345,8 @@ Modify [`package.json`]: [SSG]: https://www.staticgen.com/ [Themes]: https://hexo.io/themes/ +[lftp]: https://lftp.tech/ + [`_config.yml`]: https://gitlab.com/leonxu260/hexo-butterfly/blob/master/_config.yml [`.gitlab-ci.yml`]: https://gitlab.com/leonxu260/hexo-butterfly/blob/master/_config.yml -[`package.json`]: https://gitlab.com/leonxu260/hexo-butterfly/blob/master/package.json +[`package.json`]: https://gitlab.com/leonxu260/hexo-butterfly/blob/master/package.json \ No newline at end of file