From fcc46bba4cea4429155760923ffc3f120f9f9a88 Mon Sep 17 00:00:00 2001 From: zhixin Date: Sun, 18 Feb 2024 20:22:55 +0800 Subject: [PATCH] Update deploy instead of travis --- .github/workflows/deploy.yml | 28 +++++++++++++++ .npmignore | 3 +- .travis.yml | 18 ---------- deploy.sh | 68 ----------------------------------- deploy_key.enc | Bin 3248 -> 0 bytes 5 files changed, 29 insertions(+), 88 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .travis.yml delete mode 100755 deploy.sh delete mode 100644 deploy_key.enc diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1cf938f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy Site + +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: '0' + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6 + bundler-cache: true + + - name: Build page with Jekyll + run: bundle exec jekyll build + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: gh-pages + folder: _gh_pages diff --git a/.npmignore b/.npmignore index 92b5199..fd27b6c 100644 --- a/.npmignore +++ b/.npmignore @@ -1,7 +1,6 @@ +.github docs _config.yml -deploy_key.enc -deploy.sh Gemfile Gemfile.lock src diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 978caf3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: ruby -rvm: - - 2.4.1 - -script: bash ./deploy.sh - -branches: - only: - - master - -env: - global: - - ENCRYPTION_LABEL: "035ffe8d817f" - - COMMIT_AUTHOR_EMAIL: "wenzhixin2010@gmail.com" - -sudo: false - -cache: bundler diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index fa4be1d..0000000 --- a/deploy.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -set -e # Exit with nonzero exit code if anything fails - -SOURCE_BRANCH="master" -TARGET_BRANCH="gh-pages" - -function doCompile { - bundle exec jekyll build -} - -# Pull requests and commits to other branches shouldn't try to deploy, just build to verify -if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then - echo "Skipping deploy; just doing a build." - doCompile - exit 0 -fi - -# Save some useful information -REPO=`git config remote.origin.url` -SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} -SHA=`git rev-parse --verify HEAD` -OUT=_gh_pages - -# Clone the existing gh-pages for this repo into dist/ -# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deply) -git clone $REPO $OUT -cd $OUT -git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH -cd .. - -# Clean out existing contents -rm -rf $OUT/**/* || exit 0 - -# Run our compile script -doCompile - -# Now let's go have some fun with the cloned repo -cd $OUT -git config user.name "Travis CI" -git config user.email "$COMMIT_AUTHOR_EMAIL" - -# If there are no changes to the compiled dist (e.g. this is a README update) then just bail. -if git diff --quiet; then - echo "No changes to the output on this push; exiting." - exit 0 -fi - -# replace version -VERSION=`git log --format=%h | wc -l | xargs echo -n` -find . -type f -exec sed -i "s/v=VERSION/v=$VERSION/g" {} \; - -# Commit the "changes", i.e. the new version. -# The delta will show diffs between new and old versions. -git add -A . -git commit -m "Deploy to GitHub Pages: ${SHA}" - -# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc -ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" -ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv" -ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} -ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} -openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in ../deploy_key.enc -out ../deploy_key -d -chmod 600 ../deploy_key -eval `ssh-agent -s` -ssh-add ../deploy_key - -# Now that we're all set up, we can push. -git push $SSH_REPO $TARGET_BRANCH diff --git a/deploy_key.enc b/deploy_key.enc deleted file mode 100644 index a3eaf0ce2feb3791ec2dd4f551c7ecdd9e250a8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3248 zcmV;h3{UfnjM3kA?#p$G;ARQq1bn$;sRRw((qe>AdFg3#e`xrzd>PCG>VF8-*n!&Y zJMFU{4fhdLhDn#`r9v^x2#kB?UKvoTQVx-$J>-QIVxM?^#^KYJuPTB3CN3ZZ3B?K| zx4(1rGF;C~40*;!(%^GsNQO%j_>&B6k6S;$dJGo&D%NEi`AuiiB9BPrJN#M~9AV}C zc#-Xd#4NnDBV@e8?msSxZS3ke4Eh`&BAME0FdkIj@kHaQA{v>#!|J_XaV)qpWlL!r zpMOY>$N|&eQ({bR)0=cC!QBv&DTj4mnm#G+2|YDMN~lC6E_1qi8GqnPCpmxC8D4Qc zyft=j>-6&+a*|PzF{W!A>Zj3x7X^dZOPj$Z(!O^@GM_eai(_|^E@@jDnpkLl6`s#U zM)nTGgkR`i2n?mV++(LTp*IDEv z$aiQkCZ1)De@{PaIh%P$1!E%l=hM$3Wn7T2V(491%oD#rqp;ekRM&CH)Meyc%j#_b}>dFq3E$0xi``la9ecO%n_p2R6#i7^7zN<1)r$Q@A|kU&9n zA>DO@0`uoo2Si-|K#P1PNK0}^KRi-a*d32CEiktuV5+f0a1;QBejo=a$Gh6oEk~RK zPc_gKzG%cM z+cD;Z0>-ocnCF_mTPWxYf^sKGy=VNLn~4*(bFIhr|8S<9BxK9oIycb z;664zTt8r}@v#`pm}J&R($^*7E)7cTRFemxLo&#+I$eHY&)M2}Tx(99A{%IK2D%Ab znF&#j&>rk1Ehh{gp`%AJxe@8;!j+slM6P}gVvLn&leEN2D&dzs*cZDXPPrTY_?ha>Y?v|Ql32;m{BOkfn zAuOFQ_A5W_~7_bw)fwbF?fNgSTpZsNc$a+H#UD(J#p-6wWMzRPZyu4iAD zn>*O8n_49mdR>`$D61-QIfloD;122F5FHdtUE@G^RSq5v8<77Rg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