mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
Move everything into a “blog” directory
This commit is contained in:
38
blog/ci/travis-blog-update.sh
Normal file
38
blog/ci/travis-blog-update.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# update blog if current branch is `hugo`
|
||||
[ "$TRAVIS_BRANCH" = hugo ]
|
||||
[ "$TRAVIS_PULL_REQUEST" = false ]
|
||||
|
||||
# decrypt ssh key
|
||||
eval SSH_KEY_TRAVIS_ID=aaae456e27e9
|
||||
eval key=\$encrypted_${SSH_KEY_TRAVIS_ID}_key
|
||||
eval iv=\$encrypted_${SSH_KEY_TRAVIS_ID}_iv
|
||||
|
||||
mkdir -p ~/.ssh
|
||||
openssl aes-256-cbc -K $key -iv $iv -in ci/travis-blog_os.enc -out ~/.ssh/id_rsa -d
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
|
||||
# clone gh-pages to `deploy_blog`
|
||||
git clone --branch gh-pages git@github.com:$TRAVIS_REPO_SLUG deploy_blog
|
||||
cd deploy_blog
|
||||
|
||||
# set git user/email
|
||||
git config user.name "travis-update-bot"
|
||||
git config user.email "travis-update-bot@phil-opp.com"
|
||||
|
||||
# update blog
|
||||
rm -r *
|
||||
cp -r ../public/. .
|
||||
rm -r post post.html page page.html additional-resource additional-resource.html # remove per-category pages/feeds
|
||||
rm -r diagrams # remove diagram sources
|
||||
|
||||
# commit
|
||||
git add --all .
|
||||
: ${UPDATE_COMMIT=$TRAVIS_COMMIT}
|
||||
git commit -qm "Update blog to $UPDATE_COMMIT"
|
||||
|
||||
# push changes
|
||||
git push -q origin gh-pages
|
||||
BIN
blog/ci/travis-blog_os.enc
Normal file
BIN
blog/ci/travis-blog_os.enc
Normal file
Binary file not shown.
12
blog/ci/travis-build.sh
Normal file
12
blog/ci/travis-build.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# codegen
|
||||
cd codegen
|
||||
cargo run -- -o "../layouts/partials/recent-updates.html"
|
||||
cd ..
|
||||
|
||||
git clone https://github.com/phil-opp/blog_os.git
|
||||
cp -r blog_os/blog ../blog
|
||||
./hugo
|
||||
Reference in New Issue
Block a user