-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (46 loc) · 1.52 KB
/
deploy.yaml
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
54
55
56
name: Build and Deploy to Server
on:
push:
branches:
- master # Adjust the branch as needed
jobs:
deploy-to-server:
runs-on: ubuntu-latest
# needs: build-and-push
steps:
- name: SSH and Deploy
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_KEY }}
port: 22
script: |
cd devsoc-backend-24/
git pull origin main
sudo -S docker compose down
sudo -S docker compose up -d --build
# build-and-push:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
# - name: "Create env file"
# run: |
# echo "${{ secrets.ENV }}" > .env
# cat .env
# - name: Build Go backend Docker image
# run: |
# docker build -t shivam2002/bolt-backend:latest .
# env:
# DOCKER_BUILDKIT: 1 # Enable BuildKit for improved build performance
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Push Docker image to Docker Hub
# run: |
# docker push shivam2002/bolt-backend:latest
# env:
# DOCKER_BUILDKIT: 1 # Enable BuildKit for improved build performance