Skip to content

Commit

Permalink
Merge pull request #780 from hngprojects/dev
Browse files Browse the repository at this point in the history
Merge branch 'dev' into staging
  • Loading branch information
Homoakin619 authored Aug 13, 2024
2 parents 7af707c + d911100 commit 00e998b
Show file tree
Hide file tree
Showing 47 changed files with 477 additions and 1,553 deletions.
4 changes: 0 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,3 @@ dist
# /.env
/.env.*.local
*._local.ts

# Migrations
/db/migrations/*-migration.ts
/db
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ DB_TYPE=
DB_USERNAME=
DB_PASSWORD=
DB_HOST=
DB_DATABASE=hng
DB_NAME=hng
DB_ENTITIES=dist/src/modules/**/entities/**/*.entity{.ts,.js}
DB_MIGRATIONS=dist/db/migrations/*{.ts,.js}
POSGRES_USER=$DB_USERNAME
POST
JWT_SECRET=gsgs
JWT_EXPIRY_TIMEFRAME=1500000
DB_SSL=false
Expand All @@ -36,4 +38,4 @@ SUPPORT_EMAIL=
AUTH_PASSWORD=
BASE_URL=
FLUTTERWAVE_SECRET_KEY=
FLUTTERWAVE_BASE_URL=
FLUTTERWAVE_BASE_URL=
48 changes: 48 additions & 0 deletions .github/workflows/dev-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Dev Deployment

on:
workflow_dispatch:
push:
branches:
- dev

jobs:
build-and-push:
if: github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t nestjs_dev:green .

- name: Save and compress Docker image
run: |
docker save nestjs_dev:green | gzip > nestjs_dev.tar.gz
- name: Copy image to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "nestjs_dev.tar.gz"
target: "/tmp"

deploy:
needs: build-and-push
runs-on: ubuntu-latest
environment:
name: "dev"
url: ${{ vars.URL }}
steps:
- name: Deploy on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd ~/hng_boilerplate_nestjs
./deploy.sh dev
117 changes: 0 additions & 117 deletions .github/workflows/dev.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
name: ci
name: Lint, Build and Test

on:
pull_request:
branches:
- dev
push:
branches:
- dev

pull_request

jobs:
test-and-build-dev:
lint-build-and-test:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: '20'

- name: Install dependencies
run: npm install --include=dev

- name: Run lint
run: npm run lint

- name: Build project
run: npm run build

Expand Down
117 changes: 0 additions & 117 deletions .github/workflows/main.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/pr-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Deploy
on:
pull_request_target:
branches:
- dev

jobs:
deploy-pr-for-testing:
environment:
name: preview
url: ${{ steps.deploy.outputs.preview-url }}
runs-on: ubuntu-latest
steps:
- name: Checkout to branch
uses: actions/checkout@v4
- id: deploy
name: Pull Request Deploy
uses: hngprojects/pr-deploy@dev
with:
server_host: ${{ secrets.HOST }}
server_username: ${{ secrets.USERNAME }}
server_password: ${{ secrets.PASSWORD }}
comment: false
context: .
dockerfile: Dockerfile
exposed_port: 5000
github_token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 00e998b

Please sign in to comment.