Skip to content

Instantly share code, notes, and snippets.

@HighwayofLife
Forked from qoomon/TravisGitHub.md
Created March 22, 2018 08:42
Show Gist options
  • Save HighwayofLife/ff62af6ba74a219d1d5bbe9cad3e29ae to your computer and use it in GitHub Desktop.
Save HighwayofLife/ff62af6ba74a219d1d5bbe9cad3e29ae to your computer and use it in GitHub Desktop.

Revisions

  1. @qoomon qoomon revised this gist Sep 6, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -33,5 +33,7 @@ before_install:
    ```

    `git add '.travis.yml'`

    `git commit -m 'chore: add github deploy key'`

    `git push`
  2. @qoomon qoomon revised this gist Sep 6, 2017. 1 changed file with 0 additions and 5 deletions.
    5 changes: 0 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -30,11 +30,6 @@ before_install:
    - chmod 600 github_deploy_key
    - eval $(ssh-agent -s)
    - ssh-add github_deploy_key
    - |-
    cat >>~/.ssh/config <<EOF
    Host github.com
    IdentityFile $PWD/github_deploy_key"
    EOF
    ```

    `git add '.travis.yml'`
  3. @qoomon qoomon revised this gist Sep 6, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -30,6 +30,11 @@ before_install:
    - chmod 600 github_deploy_key
    - eval $(ssh-agent -s)
    - ssh-add github_deploy_key
    - |-
    cat >>~/.ssh/config <<EOF
    Host github.com
    IdentityFile $PWD/github_deploy_key"
    EOF
    ```

    `git add '.travis.yml'`
  4. @qoomon qoomon revised this gist Sep 6, 2017. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -20,10 +20,16 @@ set public key as deploy key on github e.g https://github.com/USER/REPO/settings
    add openssl line to before_install stage in your .travis.yml e.g.
    ```
    before_install:
    - openssl aes-256-cbc -K $encrypted_xxxxxxxxxxxx_key -iv $encrypted_xxxxxxxxxxxx_iv -in deploy-key.enc -out deploy-key -d
    - chmod 600 deploy-key
    - >-
    openssl aes-256-cbc
    -K $encrypted_xxxxxxxxxxxx_key
    -iv $encrypted_xxxxxxxxxxxx_iv
    -in github_deploy_key.enc
    -out github_deploy_key
    -d
    - chmod 600 github_deploy_key
    - eval $(ssh-agent -s)
    - ssh-add deploy-key
    - ssh-add github_deploy_key
    ```

    `git add '.travis.yml'`
  5. @qoomon qoomon revised this gist Sep 6, 2017. 1 changed file with 9 additions and 5 deletions.
    14 changes: 9 additions & 5 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,21 @@
    # Setup Travis Deploy
    `gem install travis`

    `ssh-keygen -t rsa -b 4096 -f 'deploy-key' -N ''`
    `ssh-keygen -t rsa -b 4096 -f 'github_deploy_key' -N ''`

    `cat github_deploy_key.pub | pbcopy`

    set public key as deploy key on github e.g https://github.com/USER/REPO/settings/keys

    `cat deploy-key.pub | pbcopy`
    `rm 'github_deploy_key.pub'`

    `travis login --org --auto`

    `travis encrypt-file 'deploy-key'`
    `travis encrypt-file 'github_deploy_key'`

    `rm 'github_deploy_key'`

    `rm 'deploy-key' 'deploy-key.pub'`
    `git add 'github_deploy_key.enc'`

    add openssl line to before_install stage in your .travis.yml e.g.
    ```
    @@ -22,6 +26,6 @@ before_install:
    - ssh-add deploy-key
    ```

    `git add 'deploy-key.enc' '.travis.yml'`
    `git add '.travis.yml'`
    `git commit -m 'chore: add github deploy key'`
    `git push`
  6. @qoomon qoomon created this gist Sep 6, 2017.
    27 changes: 27 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Setup Travis Deploy
    `gem install travis`

    `ssh-keygen -t rsa -b 4096 -f 'deploy-key' -N ''`

    set public key as deploy key on github e.g https://github.com/USER/REPO/settings/keys

    `cat deploy-key.pub | pbcopy`

    `travis login --org --auto`

    `travis encrypt-file 'deploy-key'`

    `rm 'deploy-key' 'deploy-key.pub'`

    add openssl line to before_install stage in your .travis.yml e.g.
    ```
    before_install:
    - openssl aes-256-cbc -K $encrypted_xxxxxxxxxxxx_key -iv $encrypted_xxxxxxxxxxxx_iv -in deploy-key.enc -out deploy-key -d
    - chmod 600 deploy-key
    - eval $(ssh-agent -s)
    - ssh-add deploy-key
    ```

    `git add 'deploy-key.enc' '.travis.yml'`
    `git commit -m 'chore: add github deploy key'`
    `git push`