Commit 47ee02c5 authored by Paul 🐻's avatar Paul 🐻

deploy: revoke old deploy_key and deploy only necessary files

parent 79bbecc6
Pipeline #7958158 passed with stages
in 2 minutes and 47 seconds
......@@ -17,5 +17,5 @@
# Ignore .DS_store file
.DS_Store
deploy_key.pem
deploy_key.pem.pub
\ No newline at end of file
deploy_travis.pem
deploy_travis.pem.pub
......@@ -4,10 +4,10 @@ install:
script:
- bundle exec middleman build --clean
after_success:
- openssl aes-256-cbc -K $encrypted_cd32eca6684a_key -iv $encrypted_cd32eca6684a_iv -in deploy_key.pem.enc -out deploy_key.pem -d
- openssl aes-256-cbc -K $encrypted_cd32eca6684a_key -iv $encrypted_cd32eca6684a_iv -in deploy_travis.pem.enc -out deploy_travis.pem -d
- eval "$(ssh-agent -s)"
- chmod 600 deploy_key.pem
- ssh-add deploy_key.pem
- chmod 600 deploy_travis.pem
- ssh-add deploy_travis.pem
deploy:
skip_cleanup: true
provider: script
......
#!/bin/bash -e
ssh_repo="git@github.com:paulRbr/paulrbr.github.io.git"
# Commit middleman build directory
git clean -dfx -e public -e deploy_key.pem
mv public/* .
git clean -dfx -e public -e deploy_travis.pem
cd public && ls -la
git init
git add .
git config --global user.email "deploy@paul.bonaud.fr"
git config --global user.name "Deploy bot"
git commit -m "deploy: publishing github pages $(date)"
ssh_repo="git@github.com:paulRbr/paulrbr.github.io.git"
# Push to gh-pages branch!
git remote set-url origin $ssh_repo
git remote add origin $ssh_repo
git push -f origin HEAD:master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment