-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4d55d9
commit 3351982
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}:~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |