Merge pull request #1 from HRulier/feature/operations #22
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: Deploy Ubuntu Server Project | |
| on: | |
| push: | |
| branches: | |
| - development | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 # Updated version | |
| - name: Add SSH private key to agent | |
| uses: webfactory/ssh-agent@v0.9.0 # Updated version | |
| with: | |
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| - name: Deploy to Server | |
| env: | |
| SERVER_USER: ${{ secrets.SERVER_USER }} | |
| SERVER_IP: ${{ secrets.SERVER_IP }} | |
| SSH_PORT: ${{ secrets.SSH_PORT }} | |
| APP_DIR: ${{ secrets.APP_DIR }} | |
| run: | | |
| ssh -o StrictHostKeyChecking=no -p $SSH_PORT $SERVER_USER@$SERVER_IP " | |
| cd $APP_DIR && | |
| git pull origin development && | |
| cd .. && | |
| docker compose -f docker-compose-prod.yml up --build -d api | |
| " |