From b0cd2028efb851986abf4280a1102845f4b6f9a3 Mon Sep 17 00:00:00 2001 From: Abhishek SAINI Date: Fri, 4 Oct 2024 08:42:30 +0200 Subject: [PATCH] update comments --- .github/workflows/build.yml | 7 ------ .github/workflows/ci.yml | 17 ++++++-------- .github/workflows/prod.yml | 47 ------------------------------------- 3 files changed, 7 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/prod.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a06820..09daf60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,6 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 - # Restore Modules cache - name: Restore Modules Cache uses: actions/cache@v3 with: @@ -48,9 +47,3 @@ jobs: MAILTRAP_TESTING_HOST: ${{ vars.MAILTRAP_TESTING_HOST}} REFRESH_TOKEN_SECRET_KEY: ${{ secrets.REFRESH_TOKEN_SECRET_KEY}} MAILTRAP_EMAIL_ENV: ${{ vars.MAILTRAP_EMAIL_ENV}} - - - name: Save ${{ inputs['environment'] }} ${{ vars.TOKEN_ISSUER}} Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs['environment'] }}-build - path: build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3342d5f..c2c9276 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,15 +20,14 @@ jobs: cache-key-prefix: 'auth' working-directory: './' - # Step: Lint the code + # Step: Linting check lint: - needs: [npm] # Wait for dependencies to be installed before linting + needs: [npm] runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v3 - # Restore Modules cache - name: Restore Modules Cache uses: actions/cache@v3 with: @@ -40,27 +39,25 @@ jobs: run: npm run lint working-directory: ./ - # Step: Formatting + # Step: Formatting check format: - needs: [npm] # Dependencies must be installed before formatting + needs: [npm] runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v3 - # Restore Modules cache - name: Restore Modules Cache uses: actions/cache@v3 with: path: node_modules key: ${{ runner.os }}-auth-${{ hashFiles('package-lock.json') }} - # Format the code with Prettier - name: Checking Formatting with Prettier run: npm run prettier working-directory: ./ - # Step: Security audit + # Step: Security audit check dependencies-check: needs: [npm] uses: SAINIAbhishek/shared-workflows/.github/workflows/security-audit.yml@main @@ -71,7 +68,7 @@ jobs: cache-key-prefix: 'auth' working-directory: './' - # Step: Build the project - dev: + # Step: Build check + build: needs: [lint, format, dependencies-check] uses: ./.github/workflows/build.yml diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml deleted file mode 100644 index bcb90c9..0000000 --- a/.github/workflows/prod.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Node Auth Application Production Pipeline - -# Trigger the workflow -on: - push: - branches: - - 'main' - -jobs: - build: - runs-on: ubuntu-latest - environment: production - steps: - - name: Checkout Code - uses: actions/checkout@v3 - - # Restore Modules cache - - name: Restore Modules Cache - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-auth-${{ hashFiles('package-lock.json') }} - - - name: Build for production - run: npm run build - working-directory: ./ - env: - 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_USERNAME: ${{ secrets.MAILTRAP_USERNAME}} - MAILTRAP_PASSWORD: ${{ secrets.MAILTRAP_PASSWORD}} - MAILTRAP_HOST: ${{ vars.MAILTRAP_HOST}} - REFRESH_TOKEN_SECRET_KEY: ${{ secrets.REFRESH_TOKEN_SECRET_KEY}} - MAILTRAP_EMAIL_ENV: ${{ vars.MAILTRAP_EMAIL_ENV}} - - - name: Save Production Build Artifacts - uses: actions/upload-artifact@v4 - with: - name: prod-build - path: build