.gitlab-ci.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # This file is a template, and might need editing before it works on your project.
  2. # To contribute improvements to CI/CD templates, please follow the Development guide at:
  3. # https://docs.gitlab.com/ee/development/cicd/templates.html
  4. # This specific template is located at:
  5. # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Jekyll.gitlab-ci.yml
  6. # Template project: https://gitlab.com/pages/jekyll
  7. # Docs: https://docs.gitlab.com/ee/pages/
  8. image: ruby:2.6
  9. variables:
  10. JEKYLL_ENV: production
  11. LC_ALL: C.UTF-8
  12. before_script:
  13. - gem install bundler
  14. - bundle install
  15. test:
  16. stage: test
  17. script:
  18. - bundle exec jekyll build -d test
  19. artifacts:
  20. paths:
  21. - test
  22. except:
  23. variables:
  24. - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  25. pages:
  26. stage: deploy
  27. script:
  28. - wget -O Mabbs/index.html https://mabbs.github.io/Mabbs/
  29. - rm -rf .git/
  30. - bundle exec jekyll build -d public
  31. - rm -rf .jekyll-cache/
  32. - tar czvf ../MayxBlog.tgz .
  33. - mv ../MayxBlog.tgz public/
  34. artifacts:
  35. paths:
  36. - public
  37. only:
  38. variables:
  39. - $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH