Skip to content

Commit

Permalink
add deploy and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Wintersunner committed Nov 12, 2023
1 parent b4d55d9 commit 3351982
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Deploy on Production

on:
push:
branches: [ master ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
DB_DRIVER: mysql
DB_NAME: ${{ secrets.DB_NAME }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: localhost
DB_PORT: 3306
ALLOWED_ORIGINS: "https://armans.ca"

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ^1.21
id: go

- name: Check out code
uses: actions/checkout@v4

- name: Create empty env file
run: touch app.env

- name: Build
run: make build

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

- name: SCP Build to Server
run: sshpass -p "${{ secrets.PASSWORD }}" scp -o StrictHostKeyChecking=no -P ${{ secrets.PORT }} -r ./main ${{ secrets.USERNAME }}@${{ secrets.HOST }}:~
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ^1.21
id: go
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Xplor Backend

![Unit Tests](https://github.com/Wintersunner/xplor-backend/actions/workflows/test.yml/badge.svg) ![Deploy](https://github.com/Wintersunner/xplor-backend/actions/workflows/deploy.yml/badge.svg)

0 comments on commit 3351982

Please sign in to comment.