进入 hexo 源文件夹
$ docker run -it --rm \
-v $PWD:/srv/hexo-src \
khs1994/hexo
$ docker run -it --rm \
-v $PWD:/srv/hexo-src \
khs1994/hexo \
server
$ docker run -it --rm \
-v $PWD:/srv/hexo-src \
-v ~/.ssh:/root/.ssh \
-e GIT_USERNAME=username \
-e [email protected] \
khs1994/hexo \
deploy
- name: SSH settings
uses: Homebrew/actions/git-ssh@master
with:
git_user: username
git_email: [email protected]
key_name: key_rsa
key: ${{ secrets.SSH_KEY }}
- name: Hexo Build
uses: docker://khs1994/hexo
- name: Hexo Deploy
if: github.event_name == 'push'
run: |
docker run -it --rm \
-v $PWD:/srv/hexo-src \
-v ~/.ssh:/root/.ssh \
-e GIT_USERNAME=username \
-e [email protected] \
khs1994/hexo \
deploy