diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb86352..6f9b6bc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,56 +1,56 @@ 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 - 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 -R ./gitrepo/.git ./_site/ + - mv ./gitrepo/.git ./_site/ - cd _site/ - git add --all . - git commit -m "Deployment at $(date)" - git push origin master only: - master