-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create ci.yml * lint * formatting * formatting the code * Update ci.yml * build workflow * check dev env * Update ci.yml * workflows * Update prod.yml * testing * test 2 * Update build.yml * Update build.yml * update comments * Update ci.yml
- Loading branch information
1 parent
01723c7
commit 914d398
Showing
9 changed files
with
145 additions
and
28 deletions.
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,49 @@ | ||
name: Build Workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment: | ||
description: 'development || production' | ||
default: development | ||
type: string | ||
working-directory: | ||
description: 'Directory where the build command will run' | ||
type: string | ||
default: './' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs['environment'] }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore Modules Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-auth-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Build for ${{ inputs['environment'] }} | ||
run: npm run build | ||
working-directory: ${{ inputs['working-directory'] }} | ||
env: | ||
NODE_ENV: ${{ inputs['environment'] }} | ||
PORT: ${{ vars.API_PORT }} | ||
MONGO_URI: ${{ vars.MONGO_URI }} | ||
MONGO_DB_HOST: ${{ vars.MONGO_DB_HOST }} | ||
TOKEN_ISSUER: ${{ vars.TOKEN_ISSUER}} | ||
TOKEN_AUDIENCE: ${{ vars.TOKEN_AUDIENCE}} | ||
CORS_URL: ${{ vars.CORS_URL}} | ||
FRONTEND_RESET_URL: ${{ vars.FRONTEND_RESET_URL}} | ||
API_VERSION: ${{ vars.API_VERSION}} | ||
ACCESS_TOKEN_SECRET_KEY: ${{ secrets.ACCESS_TOKEN_SECRET_KEY}} | ||
MAILTRAP_TESTING_USERNAME: ${{ secrets.MAILTRAP_TESTING_USERNAME}} | ||
MAILTRAP_TESTING_PASSWORD: ${{ secrets.MAILTRAP_TESTING_PASSWORD}} | ||
MAILTRAP_USERNAME: ${{ secrets.MAILTRAP_USERNAME}} | ||
MAILTRAP_PASSWORD: ${{ secrets.MAILTRAP_PASSWORD}} | ||
MAILTRAP_TESTING_HOST: ${{ vars.MAILTRAP_TESTING_HOST}} | ||
REFRESH_TOKEN_SECRET_KEY: ${{ secrets.REFRESH_TOKEN_SECRET_KEY}} | ||
MAILTRAP_EMAIL_ENV: ${{ vars.MAILTRAP_EMAIL_ENV}} |
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,74 @@ | ||
name: Node Auth Application Pipeline | ||
|
||
# Trigger the workflow | ||
on: | ||
push: | ||
branches: | ||
- '**' # Matches every branch for push events | ||
pull_request: | ||
branches: | ||
- '**' # Matches every branch for pull request events | ||
|
||
jobs: | ||
# Step: Cache and Install Dependencies | ||
npm: | ||
uses: SAINIAbhishek/shared-workflows/.github/workflows/cache-install-dependencies.yml@main | ||
with: | ||
node-version: '20.17.0' | ||
lock-file: 'package-lock.json' | ||
cache-path: 'node_modules' | ||
cache-key-prefix: 'auth' | ||
working-directory: './' | ||
|
||
# Step: Linting check | ||
lint: | ||
needs: [npm] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore Modules Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-auth-${{ hashFiles('package-lock.json') }} | ||
|
||
# Lint the server code | ||
- name: Checking Linting | ||
run: npm run lint | ||
working-directory: ./ | ||
|
||
# Step: Formatting check | ||
format: | ||
needs: [npm] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Restore Modules Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-auth-${{ hashFiles('package-lock.json') }} | ||
|
||
- name: Checking Formatting with Prettier | ||
run: npm run prettier | ||
working-directory: ./ | ||
|
||
# Step: Security audit check | ||
dependencies: | ||
needs: [npm] | ||
uses: SAINIAbhishek/shared-workflows/.github/workflows/security-audit.yml@main | ||
with: | ||
node-version: '20.17.0' | ||
lock-file: 'package-lock.json' | ||
cache-path: 'node_modules' | ||
cache-key-prefix: 'auth' | ||
working-directory: './' | ||
|
||
# Step: Build check | ||
dev: | ||
needs: [lint, format, dependencies] | ||
uses: ./.github/workflows/build.yml |
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
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
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
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