Skip to content

Commit

Permalink
Merge branch 'dev' into feat/HNG-create-waitlist-page-superadmin-team…
Browse files Browse the repository at this point in the history
…-starlight
  • Loading branch information
Pharm-ack authored Jul 29, 2024
2 parents ca76308 + 60d25fb commit 5a9626d
Show file tree
Hide file tree
Showing 42 changed files with 1,289 additions and 559 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL=https://your-teams-backend-probe-url.com
32 changes: 32 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build and Push

on:
push:
branches:
- dev

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
file: docker/development/Dockerfile
push: true
tags: hngdevops/nextjs-boilerplate:dev
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@

name: Clean CI/CD Pipeline
name: Build, Lint and Test

on:
push:
branches:
- clean
paths-ignore:
- .github/workflows/**

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
pull_request

jobs:
build:
build_lint_test:
runs-on: ubuntu-latest

steps:
Expand All @@ -24,7 +15,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Cache pnpm modules
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -52,17 +43,3 @@ jobs:

- name: Run tests
run: pnpm run test:ci

deploy:
runs-on: ubuntu-latest
needs: build

steps:
- name: Deploy to dev environment
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
./deploy_dev.sh next
40 changes: 0 additions & 40 deletions .github/workflows/checks.PR.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: PR Checks - Report Coverage
name: Coverage Report

on:
workflow_run:
workflows: ["PR Checks"]
workflows: ["build-lint-test"]
types:
- completed

jobs:
report-test:
coverage_report:
runs-on: ubuntu-latest

permissions:
Expand All @@ -19,6 +19,6 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: "Report Coverage"
- name: "Coverage Report"
if: always()
uses: davelosert/vitest-coverage-report-action@v2
68 changes: 0 additions & 68 deletions .github/workflows/dev-cicd.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/dev-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Dev Deployment

on:
workflow_run:
workflows: ["Build and Push"]
types:
- completed

jobs:
deploy_to_dev:
if: github.event.repository.fork == false
runs-on: ubuntu-latest

environment:
name: "dev"
url: ${{ vars.URL }}

steps:
- name: Deploy to dev environment
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd hng_boilerplate_nextjs
./scripts/dev_deploy.sh
67 changes: 0 additions & 67 deletions .github/workflows/prod-cicd.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/production-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Production Deployment

on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- .github/workflows/**

jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
file: docker/prod/Dockerfile
push: true
tags: hngdevops/nextjs-boilerplate:prod

deploy_to_production:
needs: build_and_push
if: github.event.repository.fork == false
runs-on: ubuntu-latest

environment:
name: "production"
url: ${{ vars.URL }}

steps:
- name: Deploy to production environment
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
cd hng_boilerplate_nextjs
./scripts/prod_deploy.sh
Loading

0 comments on commit 5a9626d

Please sign in to comment.