diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f24d03..b5f789a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,60 +1,32 @@ image: ubuntu variables: DEBIAN_FRONTEND: noninteractive before_script: - | apt-get update -qq apt-get dist-upgrade --yes apt-get install --yes ruby ruby-dev build-essential git curl curl -sSL https://deb.nodesource.com/setup_12.x | bash - apt-get install --yes nodejs gem install bundler echo "gem: --no-rdoc --no-ri" > ~/.gemrc bundle config BUNDLE_PATH ./vendor/bundle/ stages: - preview - - deploy preview: stage: preview script: - | if [[ -n "$NETLIFY_AUTH_TOKEN" ]]; then bundle install bundle exec jekyll build echo -e 'User-Agent:*\nDisallow:/' > ./_site/robots.txt npm install npm run preview else echo "Skipped deployment to preview environment. You need to set \$NETLIFY_AUTH_TOKEN to deploy." fi - -deploy: - stage: deploy - script: - # Register private key as GitLab CI's environmental variable. - # You can encode base64 by: `cat /path/to/id_rsa | base64 --wrap=0` - - | - mkdir --parents ~/.ssh - echo "$SSH_PRIVATE_KEY" | base64 --decode > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - echo -e "Host git.kde.org\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - - - git config --global user.email "kde-jp@kde.org" - - git config --global user.name "Japan KDE Users Group" - - - bundle install - - bundle exec jekyll build - - echo -e 'User-Agent:*\nAllow:/' > ./_site/robots.txt - - - git clone git@git.kde.org:websites/jp-kde-org.git gitrepo - - mv ./gitrepo/.git ./_site/ - - cd _site/ - - git add --all . - - git commit -m "Deployment at $(date)" - - git push origin master - only: - - master