Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslav Radev committed Apr 5, 2024
2 parents 16dd8d1 + 35d6a21 commit e6cf950
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/DeployToK8S.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:

- name: Install sshpass
run: sudo apt-get install -y sshpass

- name: Delay for other workflows to complete and push their images to docker hub
run: sleep 240 # Sleep for 240 seconds or 4 minutes


- name: Execute commands over SSH
env:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/FrontendPipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Deploy Frontend

on:
push:
branches: [ "main" ]
paths:
- 'Frontend/openvidstreamer-fe/**'
pull_request:
branches: [ "main" ]
paths:
- 'Frontend/openvidstreamer-fe/**'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18' # Adjust this to match your project's Node.js version

- name: Install dependencies
run: npm install
working-directory: ./Frontend/openvidstreamer-fe

- name: Install Vite globally
run: npm install -g vite

- name: Build project using Vite
run: vite build
working-directory: ./Frontend/openvidstreamer-fe

- name: Clean up target directory on server
uses: appleboy/ssh-action@master
with:
host: 145.220.74.148
username: ubuntu
password: ${{ secrets.DEPLSSH_PASSWORD }}
port: 22
script: |
find /var/www/fe -mindepth 1 -delete
- name: Copy build to server
uses: appleboy/scp-action@master
with:
host: 145.220.74.148
username: ubuntu
password: ${{ secrets.DEPLSSH_PASSWORD }}
port: 22
source: "./Frontend/openvidstreamer-fe/dist/*"
target: "/var/www/fe"
2 changes: 1 addition & 1 deletion Frontend/openvidstreamer-fe/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
</html>

0 comments on commit e6cf950

Please sign in to comment.