diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 810829e..5da8215 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,39 +1,33 @@ name: Deploy via SSH on push run-name: ${{ gitea.actor }} is deploying via SSH - on: push: branches: - main - jobs: deploy-via-ssh: runs-on: ubuntu-latest - steps: - run: echo "The job was triggered by a ${{ gitea.event_name }} event." - - run: echo "Branch: ${{ gitea.ref }}, Repository: ${{ gitea.repository }}" - + - run: echo "Branch ${{ gitea.ref }}, Repository ${{ gitea.repository }}" - name: Check out repository code uses: actions/checkout@v4 - - run: echo "Repository ${{ gitea.repository }} has been cloned to the runner." - - name: Install SSH client and Git run: | sudo apt-get update sudo apt-get install -y openssh-client git - - name: Configure SSH run: | mkdir -p ~/.ssh echo "${{ gitea.secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - - name: Deploy via SSH - run: | - echo "Connecting to ${{ gitea.secrets.SSH_USER }}@${{ gitea.secrets.SSH_HOST }} to deploy..." + run: > + echo "Connecting to ${{ gitea.secrets.SSH_USER }}@${{ + gitea.secrets.SSH_HOST }} to deploy..." + ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF' cd /path/to/your/project echo "Pulling latest changes from main..." @@ -43,5 +37,4 @@ jobs: docker-compose up -d --build echo "Deployment completed!" EOF - - run: echo "The deployment job has finished with status ${{ job.status }}."