Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Merge dev to staging #348

Merged
merged 83 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
f2cd172
feat: added crud routes for billing
Cyberguru1 Aug 8, 2024
8618072
feat: added crud routes for billing
Cyberguru1 Aug 8, 2024
9086da8
feat: added testcase for billing
Cyberguru1 Aug 8, 2024
44211fd
chore:added docs for 2fa
urizennnn Aug 8, 2024
226bda2
fix:updated swagger
urizennnn Aug 8, 2024
1441aa2
Merge pull request #326 from hngprojects/staging
vicradon Aug 8, 2024
56a0dc5
Modify pr_deploy workflow files for production, staging and development.
ekedonald Aug 8, 2024
6d4307c
PR deploy bug fix.
ekedonald Aug 8, 2024
e646cad
chore: set up different nginx configs
vicradon Aug 8, 2024
fff0367
Merge pull request #328 from hngprojects/bugfix/nginx-config
vicradon Aug 8, 2024
900c965
Merge pull request #327 from hngprojects/feat_private_key
augusthottie Aug 8, 2024
d699b44
bug fix docker
ekedonald Aug 9, 2024
b579a96
Update development.yml
ekedonald Aug 9, 2024
3d7a5ff
Create dev-deploy.yml
ekedonald Aug 9, 2024
2bd6a44
Update docker-compose.yml
ekedonald Aug 9, 2024
b27f78b
Update nginx.conf
ekedonald Aug 9, 2024
2ff67da
Merge pull request #329 from hngprojects/golang-bug
ThePrimeJnr Aug 9, 2024
9665fa0
Update dev-deploy.yml
ekedonald Aug 9, 2024
0bab64d
Merge pull request #330 from hngprojects/dev-deploy-patch-1
ThePrimeJnr Aug 9, 2024
a596635
Update dev-deploy.yml
ekedonald Aug 9, 2024
c2cef84
Merge pull request #331 from hngprojects/dev-deploy-patch-1-1
ThePrimeJnr Aug 9, 2024
d828c68
chore: setup successful docker builds
vicradon Aug 9, 2024
70a7ae6
Merge pull request #332 from hngprojects/feature/docker-successful-bu…
vicradon Aug 9, 2024
6b1d15b
chore: update dev deploy
vicradon Aug 9, 2024
221217c
Merge pull request #333 from hngprojects/bugfix/update-dev-deploy
augusthottie Aug 9, 2024
94661bf
chore: augment dev deploy set up script
vicradon Aug 9, 2024
6074359
Merge pull request #334 from hngprojects/bugfix/dev-deploy-setup-script
Babbexx-22 Aug 9, 2024
9f80e03
chore: fix workflow dispatch job
vicradon Aug 9, 2024
e02105e
Merge pull request #335 from hngprojects/bugix/fix-workflow-deploy
Babbexx-22 Aug 9, 2024
a2b1d53
Merge pull request #325 from urizennnn/feat/2FA
Cyberguru1 Aug 9, 2024
5b30e43
bugFix: fix column definition causing error
Cyberguru1 Aug 9, 2024
0bf9d34
chore: updated api docs
Micah-Shallom Aug 9, 2024
16ca181
Chore: pull from dev branch
Cyberguru1 Aug 9, 2024
50ba2fc
Merge pull request #336 from hngprojects/bugFix/JobPost-Model-Errors
Micah-Shallom Aug 9, 2024
4e36b5e
chore: changed z to s in organizations
Micah-Shallom Aug 9, 2024
fbbcf55
Merge branch 'dev' of github.com:Micah-Shallom/hng_boilerplate_golang…
Micah-Shallom Aug 9, 2024
c910d00
Merge branch 'dev' into update/org-and-api-docs
Micah-Shallom Aug 9, 2024
cf97176
chore: fixed testcases
Micah-Shallom Aug 9, 2024
f7a26d9
chore: fix on org file
Micah-Shallom Aug 9, 2024
bc4fcce
Merge branch 'dev' into update/org-and-api-docs
Micah-Shallom Aug 9, 2024
feae3da
fix: create job post
uloamaka Aug 9, 2024
6357365
chore: update workflows
vicradon Aug 9, 2024
45668b0
chore: change position of app.env workflow run
vicradon Aug 9, 2024
71cbf18
chore: update relative path
vicradon Aug 9, 2024
71eef60
Merge pull request #338 from hngprojects/feature/streamline-workflows
vicradon Aug 9, 2024
a574499
chore: update workflows
vicradon Aug 9, 2024
e2f61cf
Merge pull request #340 from hngprojects/bugfix/workflow-step
vicradon Aug 9, 2024
802e767
chore: update workflow with custom action
vicradon Aug 9, 2024
ae5a5d6
Merge pull request #341 from hngprojects/bugfix/update-dev-deploy-env…
Cyberguru1 Aug 9, 2024
796a48f
fix: removed struct on the help center service
uloamaka Aug 9, 2024
3d20297
Merge branch 'dev' into update/org-and-api-docs
Cyberguru1 Aug 9, 2024
cb8c5a6
Merge branch 'dev' into fix/create-job-post
Cyberguru1 Aug 9, 2024
a022a0b
Merge pull request #337 from Micah-Shallom/update/org-and-api-docs
Cyberguru1 Aug 9, 2024
7e0aac9
Merge branch 'dev' into fix/create-job-post
Cyberguru1 Aug 9, 2024
b38f450
Merge remote-tracking branch 'upstream/dev' into fix/create-help-cent…
uloamaka Aug 9, 2024
eec18e9
Merge remote-tracking branch 'upstream/dev' into fix/create-job-post
uloamaka Aug 9, 2024
789adfd
fix: proper naming of the jobpost service file
uloamaka Aug 9, 2024
b1d5e83
Merge branch 'fix/create-job-post' of https://github.com/uloamaka/hng…
uloamaka Aug 9, 2024
e08a6cd
chore: update the swagger yaml file
Iretoms Aug 10, 2024
b14b4ee
Merge pull request #342 from Iretoms/chore/update-swagger-docs
Micah-Shallom Aug 10, 2024
00576bc
chore: add staging deploy
vicradon Aug 10, 2024
b95a2a0
Merge pull request #343 from hngprojects/feature/staging-deploy
augusthottie Aug 10, 2024
eccfbda
Merge branch 'dev' into fix/create-job-post
Cyberguru1 Aug 10, 2024
c953d29
Merge pull request #339 from uloamaka/fix/create-job-post
Cyberguru1 Aug 10, 2024
7f96551
Rename and modify PR Deploy workflow files.
ekedonald Aug 10, 2024
480d66b
fix: standardized reponse parameter
Ajinx1 Aug 10, 2024
c434ee3
bug-fix:updated test cases to pass
Ajinx1 Aug 10, 2024
b63fecd
chore: email-service-revamp
Cyberguru1 Aug 10, 2024
99d83e3
fix: removed help center struct
uloamaka Aug 10, 2024
3b3e45f
Merge remote-tracking branch 'upstream/dev' into fix/create-help-cent…
uloamaka Aug 10, 2024
9060a21
Merge pull request #345 from Ajinx1/fix/standardized-response-parameter
Cyberguru1 Aug 10, 2024
60d77de
Merge branch 'dev' into fix/email-service-revamp
Cyberguru1 Aug 10, 2024
a881b16
chore: fix insecure check
Cyberguru1 Aug 10, 2024
61d063a
Merge branch 'dev' of github.com:hngprojects/hng_boilerplate_golang_w…
Cyberguru1 Aug 10, 2024
8289e1d
Merge branch 'fix/email-service-revamp' of github.com:hngprojects/hng…
Cyberguru1 Aug 10, 2024
db9a201
chore: change sender email address
Cyberguru1 Aug 10, 2024
f578895
Merge remote-tracking branch 'upstream/dev' into fix/create-help-cent…
uloamaka Aug 10, 2024
23d5a0f
Merge pull request #347 from uloamaka/fix/create-help-center-topic
Cyberguru1 Aug 10, 2024
064faac
Merge pull request #346 from hngprojects/fix/email-service-revamp
vicradon Aug 10, 2024
4ffb75b
Merge branch 'dev' into pr-deploy-workflow-patch
Cyberguru1 Aug 10, 2024
daaa243
Merge pull request #344 from hngprojects/pr-deploy-workflow-patch
Cyberguru1 Aug 10, 2024
bcb9852
CI: update DB Host
vicradon Aug 10, 2024
63ea61a
Merge pull request #349 from hngprojects/bugfix/add-db-host-env-creation
vicradon Aug 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build Binary and Run Tests

on:
pull_request:
branches: [dev]

jobs:
build_and_test:
runs-on: ubuntu-latest
environment: development
env:
TEST_USERNAME: postgres
TEST_PASSWORD: password
TEST_DB_NAME: db_name
TEST_DB_HOST: localhost
TEST_DB_PORT: 5432
TEST_DB_CONNECTION: pgsql
TEST_TIMEZONE: Africa/Lagos
TEST_SSLMODE: disable
TEST_MIGRATE: true
REDIS_PORT: 6379
REDIS_HOST: localhost
REDIS_DB: 0

services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: ${{ env.TEST_USERNAME }}
POSTGRES_PASSWORD: ${{ env.TEST_PASSWORD }}
POSTGRES_DB: ${{ env.TEST_DB_NAME }}
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set Golang
uses: actions/setup-go@v4
with:
go-version: "1.22.1"
- name: Create app config file
run: cp app-sample.env app.env
- name: Build the application
run: go build -o development_app
- name: Run the application
run: nohup ./development_app > /dev/null 2>&1 &
- name: Wait for application to start
run: |
for i in {1..30}; do
curl -s http://localhost:8019 && break
sleep 1
done
- name: Run All Tests
run: go test ./... -timeout 300s
100 changes: 100 additions & 0 deletions .github/workflows/dev-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Dev Deployment

on:
workflow_dispatch:
push:
branches:
- dev

jobs:
build_and_upload_image:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
environment: development
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t golang_dev .
- name: Save and compress Docker image
run: docker save golang_dev | gzip > golang_dev.tar.gz
- name: Copy image to server
uses: appleboy/[email protected]
with:
host: ${{ env.SSH_HOST }}
username: ${{ env.SSH_USERNAME }}
password: ${{ env.SSH_PASSWORD }}
source: golang_dev.tar.gz
target: "/tmp"

update_repo_and_create_env:
runs-on: ubuntu-latest
needs: build_and_upload_image
if: github.event.repository.fork == false
environment: development
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create app.env file
uses: vicradon/[email protected]
with:
action_input_file: "app-sample.env"
APP_NAME: "development"
APP_URL: "https://deployment.api-golang.boilerplate.hng.tech"
SERVER_PORT: ${{ secrets.SERVER_PORT }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_HOST: ${{ secrets.DB_HOST }}
POSTGRES_USER: ${{ secrets.USERNAME }}
POSTGRES_PASSWORD: ${{ secrets.PASSWORD }}
POSTGRES_DB: ${{ secrets.DB_NAME }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_DB: "0"
MAIL_SERVER: ${{ secrets.MAIL_SERVER }}
MAIL_USERNAME: ${{ secrets.MAIL_USERNAME }}
MAIL_PASSWORD: ${{ secrets.MAIL_PASSWORD }}
MAIL_PORT: ${{ secrets.MAIL_PORT }}
MIGRATE: "true"

- name: Copy app.env to server
uses: appleboy/[email protected]
with:
host: ${{ env.SSH_HOST }}
username: ${{ env.SSH_USERNAME }}
password: ${{ env.SSH_PASSWORD }}
source: app.env
target: "~/deployments/development"

run_docker_container:
runs-on: ubuntu-latest
needs: [build_and_upload_image, update_repo_and_create_env]
if: github.event.repository.fork == false
environment: development
env:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
steps:
- name: Restart containers
uses: appleboy/[email protected]
with:
host: ${{ env.HOST }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}
script: |
cd ~/deployments/development
git reset --hard
git pull origin dev
gunzip -c /tmp/golang_dev.tar.gz | docker load
rm -f /tmp/golang_dev.tar.gz
docker compose -f docker-compose.yml up -d
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: PR Deploy
name: PR Deploy for Development
on:
pull_request:
types: [opened, synchronize, reopened, closed]
# pull_request:
# branches: [dev]
# types: [opened, synchronize, reopened, closed]
workflow_dispatch:

jobs:
Expand All @@ -14,7 +15,7 @@ jobs:
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}

steps:
- name: Checkout to branch
Expand All @@ -25,7 +26,7 @@ jobs:
with:
server_host: ${{ env.SSH_HOST }}
server_username: ${{ env.SSH_USERNAME }}
server_password: ${{ secrets.SERVER_PASSWORD }}
server_password: ${{ env.SSH_PASSWORD }}
server_port: ${{ env.SSH_PORT }}
comment: true
context: '.'
Expand Down
184 changes: 0 additions & 184 deletions .github/workflows/development.yml

This file was deleted.

Loading
Loading