Skip to content

Commit

Permalink
fix: push binary golang
Browse files Browse the repository at this point in the history
  • Loading branch information
AfandyW committed Oct 7, 2024
1 parent 6ddf191 commit 209a3b3
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ on:
- development

jobs:
# build:
# runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

# steps:
# - name: Checkout Code
# uses: actions/checkout@v2
steps:
- name: Checkout Code
uses: actions/checkout@v2

# - name: Set up Go
# uses: actions/setup-go@v2
# with:
# go-version: '1.20'
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.20'

# - name: Build
# run: go build -v ./...
- name: Test
run: go test -v ./...

# - name: Test
# run: go test -v ./...
- name: Build
run: go build -o main .

- name: Archive Build Output
run: tar -czvf main.tar.gz main

deploy:
runs-on: ubuntu-latest
Expand All @@ -44,8 +47,6 @@ jobs:
ssh -o StrictHostKeyChecking=no -i vps_key.pem $VPS_USER@$VPS_IP "
cd /home/hmcroot/app/development/lms-be &&
git restore . && git pull origin development &&
export PATH=\$PATH:/usr/local/go/bin &&
go mod tidy &&
go build -o main . &&
rm -f main &&
tar -xzvf main.tar.gz &&
sudo systemctl restart lms-be-development.service"

0 comments on commit 209a3b3

Please sign in to comment.