Skip to content

Commit c37f9f8

Browse files
committed
Add actions workflow
1 parent 86d51f1 commit c37f9f8

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
14+
concurrency:
15+
group: automatic_deployment
16+
cancel-in-progress: true
17+
18+
name: Deploy
19+
steps:
20+
- name: Deploy to server
21+
uses: appleboy/ssh-action@master
22+
with:
23+
host: ${{ secrets.REMOTE_HOST }}
24+
username: ${{ secrets.REMOTE_USER }}
25+
key: ${{ secrets.KEY }}
26+
port: ${{ secrets.PORT }}
27+
script: |
28+
cd /var/www/kent-hack-it
29+
echo "Fetching changes from Github"
30+
git fetch
31+
echo "Pulling Changes from Github"
32+
git pull
33+
echo "Building docker"
34+
docker compose build
35+
echo "Starting docker"
36+
docker compose up -d --force-recreate

0 commit comments

Comments
 (0)