Skip to content

Instantly share code, notes, and snippets.

@gatespace
Last active August 4, 2017 14:02
Show Gist options
  • Save gatespace/1b6f889a387e4dbccbb2b6482377fd9d to your computer and use it in GitHub Desktop.
Save gatespace/1b6f889a387e4dbccbb2b6482377fd9d to your computer and use it in GitHub Desktop.
Travis CI でビルドが成功した場合だけ Netlify にデプロイ ref: http://qiita.com/gatespace/items/146b75de89df6abc5ddb
id_rsa
id_rsa.pub
id_rsa
id_rsa.pub
language: ruby
rvm:
- 2.3.3
before_install:
- 'if [ "$TRAVIS_BRANCH" == master ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then bash ./script/before_install.sh; fi'
before_script:
- chmod +x ./script/cibuild # or do this locally and commit
script: ./script/cibuild
# blocklist
branches:
except:
- release
after_success:
- '[ "$TRAVIS_BRANCH" == master ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && bash ./script/deploy.sh'
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
sudo: false # route your build to the container-based infrastructure for a faster build
#!/bin/bash
openssl aes-256-cbc -K $encrypted_xxxx_key -iv $encrypted_xxxx_iv -in travis_key.enc -out id_rsa -d
cp id_rsa ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host github.com\n\tStrictHostKeyChecking no\nHost github github.com\n\tHostName github.com\n\tIdentityFile ~/.ssh/id_rsa\n\tUser git\n" >> ~/.ssh/config
git config --global user.email "[email protected]"
git config --global user.name "example user"
#!/bin/bash
git config --replace-all remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
git config core.filemode false
git fetch
git checkout -b release origin/release
git merge origin/master
git push [email protected]:example/example.git release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment