name: Gitea Actions Official-website
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ gitea.actor }}
on:
    push:
        branches:
            - dev

jobs:
    deploy-dev:
        runs-on: ubuntu-latest
        steps:
            - name: Setup SSH
              run: |
                  mkdir -p ~/.ssh
                  echo "${{ secrets.SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
                  chmod 600 ~/.ssh/id_rsa
                  ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
            - name: Deploy application
              run: |
                  ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} << 'EOF'
                    set -e
                    cd /www/wwwroot/dev.ow.f2b211.com

                    # 拉取最新代码
                    git pull --rebase
                  EOF
