From bce22b5d87c0866df6ac11f9f8d23959cacb74f6 Mon Sep 17 00:00:00 2001 From: Peter Harrison <16875803+palisadoes@users.noreply.github.com> Date: Fri, 27 Dec 2024 02:52:13 -0800 Subject: [PATCH] v18 - Configure & Install docs-admin.talawa.io Docusaurus Site (#2969) * Added docusaurus to eslint ignorePatterns * Removed blog references * Added Docusaurus deployment GitHub Actions * Added Docs website installation guide * Minor edit to docs/README.md * Updated eslint to ignore docs/ directory * CodeRabbit suggestions. Removed tsconfig.json file causing errors * Updated gitignore file * Updated gitignore file * Removed docs/tsconfig.json causing deployment errors * Added yarn path to GitHub action * Added Codecov ignore path * Added .nojekyll * Created deploy website workflow specific to the develop-postgres branch * Created deploy website workflow specific to the develop-postgres branch v2 * Created deploy website workflow specific to the develop-postgres branch v4.1 * Created deploy website workflow specific to the develop-postgres branch v5 * Created deploy website workflow specific to the develop-postgres branch v6 * Created deploy website workflow specific to the develop-postgres branch v7 * Created deploy website workflow specific to the develop-postgres branch v8 * Created deploy website workflow specific to the develop-postgres branch v10 * Created deploy website workflow specific to the develop-postgres branch v12 * Created deploy website workflow specific to the develop-postgres branch v13 * Created deploy website workflow specific to the develop-postgres branch v14 * Created deploy website workflow specific to the develop-postgres branch v15 * Created deploy website workflow specific to the develop-postgres branch v16 * Created deploy website workflow specific to the develop-postgres branch v17 * Created deploy website workflow specific to the develop-postgres branch v17 --- .github/workflows/push-deploy-website.yml | 8 +- .github/workflows/push.yml | 123 ++++++++-------------- 2 files changed, 53 insertions(+), 78 deletions(-) diff --git a/.github/workflows/push-deploy-website.yml b/.github/workflows/push-deploy-website.yml index ce90ce6430..e03dab9840 100644 --- a/.github/workflows/push-deploy-website.yml +++ b/.github/workflows/push-deploy-website.yml @@ -26,7 +26,13 @@ jobs: # Run only if the develop-postgres branch and not dependabot if: ${{ github.actor != 'dependabot[bot]' }} environment: - name: gh-pages + # This "name" has to be the repos' branch that contains + # the current active website. There must be an entry for + # the same branch in the PalisadoesFoundation's + # "Code and automation > Environments > gigithub-pages" + # menu. The branch "name" must match the branch in the + # "on.push.branches" section at the top of this file + name: develop-postgres url: https://docs-admin.talawa.io steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a6194b4e97..7f7328b38c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,85 +9,54 @@ ############################################################################## ############################################################################## -# name: PUSH Workflow - All Branches +name: PUSH Workflow - All Branches -# on: -# push: -# branches: -# - '**' +on: + push: + branches: + - '**' -# env: -# CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }} +env: + CODECOV_UNIQUE_NAME: CODECOV_UNIQUE_NAME-${{ github.run_id }}-${{ github.run_number }} -# jobs: -# Code-Coverage: -# if: ${{ github.actor != 'dependabot[bot]' }} -# name: Test and Calculate Code Coverage -# runs-on: ubuntu-latest -# strategy: -# matrix: -# node-version: [22.x] -# steps: -# - uses: actions/checkout@v4 -# - uses: actions/setup-node@v4 -# with: -# node-version: ${{ matrix.node-version }} +jobs: + Code-Coverage: + if: ${{ github.actor != 'dependabot[bot]' }} + name: Test and Calculate Code Coverage + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [22.x] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} -# - name: Cache node modules -# id: cache-npm -# uses: actions/cache@v4 -# env: -# cache-name: cache-node-modules -# with: -# path: | -# ~/.npm -# node_modules -# key: ${{ runner.os }}-code-coverage-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} -# restore-keys: | -# ${{ runner.os }}-code-coverage-${{ env.cache-name }}- -# ${{ runner.os }}-code-coverage- -# ${{ runner.os }}- + - name: Cache node modules + id: cache-npm + uses: actions/cache@v4 + env: + cache-name: cache-node-modules + with: + path: | + ~/.npm + node_modules + key: ${{ runner.os }}-code-coverage-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-code-coverage-${{ env.cache-name }}- + ${{ runner.os }}-code-coverage- + ${{ runner.os }}- -# - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} -# name: List the state of node modules -# run: npm install -# - run: npm run test -- --watchAll=false --coverage -# - name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}} -# uses: codecov/codecov-action@v5 -# with: -# token: ${{ secrets.CODECOV_TOKEN }} -# verbose: true -# gcov_ignore: 'docs/' -# fail_ci_if_error: false -# name: '${{env.CODECOV_UNIQUE_NAME}}' - - # Deploy-Docusaurus: - # name: Deploy https://docs-admin.talawa.io website - # runs-on: ubuntu-latest - # needs: [Code-Coverage] - # # Run only if the develop-postgres branch and not dependabot - # if: ${{ github.actor != 'dependabot[bot]' && github.event.pull_request.base.ref == 'develop-postgres' }} - # environment: - # name: github-pages - # url: https://docs-admin.talawa.io - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-node@v4 - # with: - # node-version: 22 - # cache: yarn - # cache-dependency-path: 'docs/' - # - uses: webfactory/ssh-agent@v0.5.0 - # with: - # ssh-private-key: ${{ secrets.DEPLOY_GITHUB_PAGES }} - # - name: Deploy to GitHub Pages - # env: - # USE_SSH: true - # GIT_USER: git - # working-directory: ./docs - # run: | - # git config --global user.email "actions@github.com" - # git config --global user.name "gh-actions" - # yarn install --frozen-lockfile - # yarn deploy - \ No newline at end of file + - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} + name: List the state of node modules + run: npm install + - run: npm run test -- --watchAll=false --coverage + - name: Present and upload coverage to Codecov as ${{env.CODECOV_UNIQUE_NAME}} + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true + gcov_ignore: 'docs/' + fail_ci_if_error: false + name: '${{env.CODECOV_UNIQUE_NAME}}'