Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…e_nextjs into refactor/restructure-email-templates
  • Loading branch information
kinxlo committed Jul 26, 2024
2 parents 30a8323 + 1571986 commit 720ff82
Show file tree
Hide file tree
Showing 6 changed files with 334 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/checks.PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR Checks

on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install
- name: "Test"
run: pnpm run test:ci -- --max-warnings 0
- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install
- uses: reviewdog/action-eslint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true
eslint_flags: ". --ext js,jsx,ts,tsx --ignore-path=.gitignore --max-warnings 0"
68 changes: 68 additions & 0 deletions .github/workflows/clean-cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

name: Clean CI/CD Pipeline

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

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

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Lint code
run: pnpm lint

- name: Build email
run: pnpm email:build

- name: Build project
run: pnpm build

- 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
24 changes: 24 additions & 0 deletions .github/workflows/coverage.PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR Checks - Report Coverage

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

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

permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: "Report Coverage"
if: always()
uses: davelosert/vitest-coverage-report-action@v2
68 changes: 68 additions & 0 deletions .github/workflows/dev-cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

name: Development CI/CD Pipeline

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

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

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Lint code
run: pnpm lint

- name: Build email
run: pnpm email:build

- name: Build project
run: pnpm build

- 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
67 changes: 67 additions & 0 deletions .github/workflows/prod-cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Production CI/CD Pipeline

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

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

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Lint code
run: pnpm lint

- name: Build email
run: pnpm email:build

- name: Build project
run: pnpm build

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

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

steps:
- name: Deploy to prod environment
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
./deploy_prod.sh next
67 changes: 67 additions & 0 deletions .github/workflows/staging-cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Staging CI/CD Pipeline

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

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

jobs:
build:
runs-on: ubuntu-latest

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

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

- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install

- name: Lint code
run: pnpm lint

- name: Build email
run: pnpm email:build

- name: Build project
run: pnpm build

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

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

steps:
- name: Deploy to staging environment
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
./deploy_staging.sh next

0 comments on commit 720ff82

Please sign in to comment.