Skip to content

Build and Deploy

Build and Deploy #7

Workflow file for this run

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