Skip to content

Commit

Permalink
Add build_and_push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Rivixer committed Apr 21, 2024
1 parent 2cb9fb1 commit 4848550
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Run

on:
push:
branches:
- test-github-actions

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Connect to Raspberry Pi and restart the backend
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.RASPBERRY_PI_HOST }}
username: ${{ secrets.RASPBERRY_PI_USERNAME }}
password: ${{ secrets.RASPBERRY_PI_PASSWORD }}
port: ${{ secrets.RASPBERRY_PI_PORT }}
script: |
cd /backend
git pull
docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker build -t backend .
docker run -d -p 8082:8080 backend

0 comments on commit 4848550

Please sign in to comment.