Created
May 22, 2020 02:59
-
-
Save gythialy/bb48e26bb91ea47b70a9073d578b9e60 to your computer and use it in GitHub Desktop.
deploy Hexo by GitHub Actions
This file contains hidden or 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
| name: Main workflow | |
| on: | |
| push: | |
| branches: | |
| - raw | |
| jobs: | |
| build: | |
| runs-on: ubuntu-18.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js lts | |
| uses: actions/setup-node@v2-beta | |
| with: | |
| node-version: '12.x' | |
| - name: prepare build env | |
| env: | |
| GH_ACTION_DEPLOY_KEY: ${{ secrets.GH_ACTION_DEPLOY_KEY }} | |
| NEXT_VERSION: v8.0.0-rc.2 | |
| run: | | |
| mkdir -p ~/.ssh/ | |
| echo "$GH_ACTION_DEPLOY_KEY" > ~/.ssh/id_rsa | |
| chmod 600 ~/.ssh/id_rsa | |
| ssh-keyscan github.com >> ~/.ssh/known_hosts | |
| git config --global user.name 'gythialy' | |
| git config --global user.email 'gythialy@users.noreply.github.com' | |
| npm i -g hexo-cli | |
| npm i | |
| git clone --branch ${NEXT_VERSION} --depth=10 git@github.com:next-theme/hexo-theme-next.git themes/next | |
| git checkout -b ${NEXT_VERSION} | |
| git clone git@github.com:next-theme/theme-next-three --depth=1 themes/next/source/lib/three | |
| # git clone git@github.com:next-theme/theme-next-fancybox3 --depth=1 themes/next/source/lib/fancybox | |
| git clone git@github.com:next-theme/theme-next-pace --depth=1 themes/next/source/lib/pace | |
| - name: deploy to github | |
| env: | |
| HEXO_ALGOLIA_INDEXING_KEY: ${{ secrets.HEXO_ALGOLIA_INDEXING_KEY }} | |
| run: | | |
| hexo generate && hexo algolia && hexo deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment