Build and Deploy #7
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 | |
| on: | |
| push: | |
| branches: [main] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: automatic_deployment | |
| cancel-in-progress: true | |
| name: Deploy | |
| steps: | |
| - name: Deploy to server | |
| uses: appleboy/ssh-action@master | |
| with: | |
| host: ${{ secrets.REMOTE_HOST }} | |
| username: ${{ secrets.REMOTE_USER }} | |
| key: ${{ secrets.KEY }} | |
| port: ${{ secrets.PORT }} | |
| script: | | |
| cd /var/www/kent-hack-it | |
| echo "Fetching changes from Github" | |
| git fetch | |
| echo "Pulling Changes from Github" | |
| git pull | |
| echo "Building docker" | |
| cd docker | |
| docker compose build | |
| echo "Starting docker" | |
| docker compose up -d --force-recreate |