Last active
December 17, 2015 00:18
-
-
Save wake/5519563 to your computer and use it in GitHub Desktop.
Auto deploy Octopress with Github + Travis-CI.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
branches: | |
only: | |
- master | |
language: ruby | |
rvm: | |
- 1.9.3 | |
before_script: | |
# Set the git config stuff, so Git stops yelling at us | |
- git config --global user.name "wake" | |
- git config --global user.email "[email protected]" | |
# Set read-write git origin | |
- git remote set-url origin $REPO.git | |
# Unpack ssh key for git | |
- echo -n $id_rsa_{00..30} >> ~/.ssh/id_rsa_base64 | |
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa | |
- chmod 600 ~/.ssh/id_rsa | |
# Disable SSH server fingerprint verification | |
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config | |
# Set deployment target to github pages | |
- rake setup_github_pages[$REPO] | |
# To reset the 'url' to the custom domain in '_config.yml' | |
- git checkout -- _config.yml | |
script: | |
# Set language to zh-TW utf-8 | |
- set LANG=zh_TW.UTF-8 | |
- set LC_ALL=zh_TW.UTF-8 | |
# Generate site | |
- rake generate | |
after_script: | |
# Deploy! | |
- rake deploy | |
env: | |
global: | |
# Repo read-write address | |
- REPO="[email protected]:wakefield/wake.gs" | |
# SSH key. Encoded. See https://gist.github.com/4242707 | |
- secure: "PNRtS8sa/kbCwqCMwctnYczf7hm5T8ORfzNUCZVBpFSCthAg729L1bpNPn6O\n81Ku2iPyQiiICs63VVGMuNtNv8IWsFjf5WvdBGsminr7C2V5lIOgexXblMI6\nMrmRVBSyIYZ/VZ6y9smZXw729aRxH1tjCrfeozkGzIHJBOjfTH8=" | |
- secure: "Nn0vHNcgUmS7IOt+AOYpiN5bWb2vXsHQx2siaw3HxzM2FpSUim48SHXe6xIp\nYiLN4a4zgLuxn2azP9VYDub31SzBuUBDcx59gbLKNIx1chIsjfKx/eAkvuYz\nMI/n1/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EaECCJYANCEmmLgdKS6xOq1kVmVXWuLimVSLw9zZuPfL\nRNZJveoL8nemUdNDdEKWXnmmX8NSKZiZaUdziyop9b9hPm9IqK8=" | |
- secure: "BYFsZ1tbN7F9apkPb9wv9ql5i0M67kRfdHciOeuXKvT76zokDnh6t0qnXx6y\nwWw7mFIvGeoG1t8OW3wad0lhHhxTnP3Jx0spn9tUTP0giMMkqhVWrGDhUnKS\nbXCgifQVDfDi9WDE/N3zUDNsM/f7kpkQq381zJCkTZIFkz8OKts=" | |
- secure: "NySjOR8DU8+0D7++i5RE+dPnFMGNyxp95P+/NwqTO6ZZhWg5RiJca7j4K0On\nW9AhZyzcJyzvejEcS1qTFggyNTigzw7srjv/znJTy0sEn5inR3mQKlFbSCse\nKLh39d9qhOwgPg4RUz7NYcgXZ7XYaUk276cZmpPdnnx9vekNDk0=" | |
- secure: "kRUjT7GGdCYbni8PVX0K5KKkI5Wi56exkmz+c0sYyJZ3PGP12Eu8L1ssXFio\nUyPSoKXfXMgav6HYQyKYgvjH2Jc562S5S09aZoXE+tXNXF4GwrPNAZhFr2j0\nTSSuHLAFrYgP81Qf4XFunA25arkwM6AJymb5l5zgjtKNflogFpw=" | |
- secure: "n355BnPQgt0l43bG0RWggTTX39Bbvis9SwYLemofGJj2FrE1FJQ46zBKhD2a\nchV2AsgObY5qpVdztqmwzI21Bjx/VVgaqj2gR2pdYWnIzd1phlJj/QXIS8+U\nS7MJY7e16/HmUsWoOKvlk+aA86o65ETr8cZuL4ZvxWwfhcdw+0I=" | |
- secure: "YDfldaPeifRTTBl7bA3f3tNaYt+VekWnLk83sSneMpVcJT/+rBaKPjQgmyGX\ntVJkdLxqZgrtzMlwkC8qOkIHCvJuIwgS4LxCwoNyhZuivTI2jMwImydMq9/R\nrLTRcKr23Cm9MsGdox+UbKYfmCH32ZdmFyEn+NAeYV8HYrAS2hU=" | |
- secure: "h3BHYUVTbcZVMT7tqADDqdEOrJfVDUznWbwPwQXgMoT+NR7u9Wc44Tqh9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COguFVg6/Zt5ZYolvP+X1lFE5ybmYfnHddgRNf+jQ9dxKg\nkyAAiqB329oXcwehlopEwbyrmD0dWLaNqOL077CPntA7fM1wnB7U7WMfBF7N\naRsWrURRILVbHDPl7TIL3zmv+2UTkAF9DRwXtlJz6USU2ndGxbE=" | |
- secure: "HWb2+tzUJV7LyC507Dtrg8eCgTfGFn9q7VlhyGr0Jh3J+HQPfMIQEpJFnV+x\ndwvZ3a8uYje1u1PSGltrvtwlrcSnwo9+qb48/DGvg2hPJWXRgBmFEdS4iJ7S\nNcShUk/Gw10VknXabf8FPi9wxK7CRazmzyHmQFlyELeJ+aPSMr8=" | |
- secure: "U4XBbZunvnkh8iPHMyoFYNuBorubEiCLODZu/bgCs0MC0vjpdf0kCYIkbdct\nOG0/LKmuX+7w7up253ZDKvGTRmRhpYu4GqalI73LP9v+j6BPPS93BwV173pR\nph40eGrejQqmMtLy6ngaZ2LCjxDQmrfhYwj3Z++8xHpF9dFPRts=" | |
- secure: "VRqQGL4vhjl7BsBXzzrMKua3A6sJtcUx46sQ1nGO3mUZsnudr/B6gI9xuFCt\ns5EQRX7wB5NVzhSXDtcllVxNyY2YDLL2v74ejGgeqn9IiylQF4kPWTXWCjIj\nBQgx2O6pHbyvyGGgdCo9H+rK+yQfClkXZGkY2/CW4BbtpBddy0w=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To generate secure SSH deploy key for a github repo to be used from Travis | |
base64 --wrap=0 ~/.ssh/id_rsa_deploy > ~/.ssh/id_rsa_deploy_base64 | |
ENCRYPTION_FILTER="echo \$(echo \"- secure: \")\$(travis encrypt \"\$FILE='\`cat $FILE\`'\" -r floydpink/harimenon.com)" | |
split --bytes=100 --numeric-suffixes --suffix-length=2 --filter="$ENCRYPTION_FILTER" ~/.ssh/id_rsa_deploy_base64 id_rsa_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To reconstitute the private SSH key once running inside Travis (typically from 'before_script') | |
echo -n $id_rsa_{00..30} >> ~/.ssh/id_rsa_base64 | |
base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config | |
view rawtravis-secure-key.shThis Gist brought to you by GitHub. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment