Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
robertocommit committed Jul 19, 2024
1 parent d2accbd commit e88a8f3
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Golang Translator

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

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

- name: Deploy to Server
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
echo "------> Setting GOPATH..."
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
echo "------> Changing to BackendTranslator directory..."
cd /root/BackendTranslator
echo "------> Setting environment variables..."
. ./set_env_variables.sh
echo "------> Pulling latest changes from Git..."
git pull origin main
echo "------> Building the application..."
go build
echo "------> Stopping BackendTranslator service..."
sudo systemctl stop BackendTranslator
echo "------> Starting BackendTranslator service..."
sudo systemctl start BackendTranslator
echo "------> Deployment complete."

0 comments on commit e88a8f3

Please sign in to comment.