-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (48 loc) · 1.67 KB
/
deploy.yml
File metadata and controls
53 lines (48 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# name: Build Images
# on:
# push:
# branches:
# - dev
# # workflow_run:
# # workflows: [noxus]
# # types: [completed]
# jobs:
# build:
# runs-on: ubuntu-latest
# # if: ${{ github.event.workflow_run.conclusion == 'success' }}
# steps:
# - name: Check out code
# uses: actions/checkout@v2
# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
# - name: Build and push Backend
# uses: docker/build-push-action@v3
# with:
# context: .
# file: ./Backend/Dockerfile
# push: true
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/backend:latest
# - name: Build and push Frontend latest
# uses: docker/build-push-action@v3
# with:
# context: .
# file: ./frontend/Dockerfile
# push: true
# tags: ${{ secrets.DOCKERHUB_USERNAME }}/frontend:latest
# - name: Deploy Apps
# run: |
# echo "${{ secrets.SSH_KEY }}" > id_rsa
# sudo chmod 600 id_rsa
# ssh -i id_rsa -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} '
# sudo su
# cd /home/noxus
# sudo docker stop frontend backend
# sudo docker rm frontend backend
# sudo docker rmi -f tapeart/frontend:latest tapeart/backend:latest
# sudo docker compose pull
# sudo docker compose up -d --build frontend
# sudo docker compose up -d --build backend
# sudo docker system prune -af && exit'