删除comsince.cn域名配置 #17
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: Build and Deploy Jekyll | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.0 | |
| - name: Install dependencies | |
| run: bundle install | |
| - name: Build Jekyll | |
| run: bundle exec jekyll build | |
| # - name: Upload to server | |
| # uses: appleboy/ssh-action@master | |
| # with: | |
| # host: ${{ secrets.SERVER_HOST }} | |
| # username: ${{ secrets.SERVER_USERNAME }} | |
| # #这里的private key 是本地生成的,然后自己本地服务ssh,成功之后,进行远程服务登录,然后将本地的privatekey保存到github变量中 | |
| # key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| # script: | | |
| # rsync -azv --delete comsince.github.io/_site/ /data/boot/comsince.cn | |
| - name: Deploy to Server # 第二步,rsync推文件 | |
| uses: easingthemes/ssh-deploy@v5.0.3 # 使用别人包装好的步骤镜像 | |
| with: | |
| SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
| ARGS: '-avzr --delete' | |
| REMOTE_HOST: ${{ secrets.SERVER_HOST }} | |
| REMOTE_USER: ${{ secrets.SERVER_USERNAME }} | |
| SOURCE: '_site/' | |
| TARGET: '/data/boot/comsince.cn' | |
| - name: SSH into server | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.SERVER_HOST }} | |
| username: ${{ secrets.SERVER_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| script: | | |
| nginx -t | |
| nginx -s reload |