Skip to content

Commit

Permalink
Update push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tasneemkoushar authored Feb 4, 2024
1 parent 2fddf9e commit 46e17a2
Showing 1 changed file with 71 additions and 71 deletions.
142 changes: 71 additions & 71 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,89 +58,89 @@ jobs:
fail_ci_if_error: false
name: '${{env.CODECOV_UNIQUE_NAME}}'

Generate-Documentation:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/automated-docs'
steps:
- name: Checkout the Repository
uses: actions/checkout@v3
# Generate-Documentation:
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/automated-docs'
# steps:
# - name: Checkout the Repository
# uses: actions/checkout@v3

- name: Node.js Version
uses: actions/setup-node@v4
with:
node-version: '20'
# - name: Node.js Version
# uses: actions/setup-node@v4
# with:
# node-version: '20'

- name: Restore node_modules from cache
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-generate-docs-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-generate-docs-${{ env.cache-name }}-
${{ runner.os }}-generate-docs-
${{ runner.os }}-
# - name: Restore node_modules from cache
# id: cache-npm
# uses: actions/cache@v3
# env:
# cache-name: cache-node-modules
# with:
# path: |
# ~/.npm
# node_modules
# key: ${{ runner.os }}-generate-docs-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-generate-docs-${{ env.cache-name }}-
# ${{ runner.os }}-generate-docs-
# ${{ runner.os }}-

- name: Install dependencies
run: npm install
# - name: Install dependencies
# run: npm install

- name: Install TypeScript Globally and add GraphQL tag
run: yarn global add typescript
- run: yarn add graphql-tag
# - name: Install TypeScript Globally and add GraphQL tag
# run: yarn global add typescript
# - run: yarn add graphql-tag

- name: Update Dependencies
run: yarn upgrade
# - name: Update Dependencies
# run: yarn upgrade

- name: Generate Documentation of Markdown pages
run: |
npm install --global typedoc
npm install typedoc-plugin-markdown
npm install --save-dev @types/node
npx typedoc --entryPoints src/components src/screens --out talawa-admin-docs --plugin typedoc-plugin-markdown --theme markdown --entryPointStrategy expand --exclude "**/*.test.ts" --exclude "**/*.css"
# - name: Generate Documentation of Markdown pages
# run: |
# npm install --global typedoc
# npm install typedoc-plugin-markdown
# npm install --save-dev @types/node
# npx typedoc --entryPoints src/components src/screens --out talawa-admin-docs --plugin typedoc-plugin-markdown --theme markdown --entryPointStrategy expand --exclude "**/*.test.ts" --exclude "**/*.css"

- name: Make Markdown Files MDX Compatible
run: python ./.github/workflows/md_mdx_format_adjuster.py --directory talawa-admin-docs
# - name: Make Markdown Files MDX Compatible
# run: python ./.github/workflows/md_mdx_format_adjuster.py --directory talawa-admin-docs


- name: Checking doc updated
id: DocUpdated
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "updateDoc=true" >> $GITHUB_OUTPUT
echo -e "Documentation has been updated!!"
else
Green='0;32'
NoColor='\033[0m'
echo -e "${Green}No documentation updated${NoColor}"
fi
# - name: Checking doc updated
# id: DocUpdated
# run: |
# if [ -n "$(git status --porcelain)" ]; then
# echo "updateDoc=true" >> $GITHUB_OUTPUT
# echo -e "Documentation has been updated!!"
# else
# Green='0;32'
# NoColor='\033[0m'
# echo -e "${Green}No documentation updated${NoColor}"
# fi

- name: Set env variables
if: steps.DocUpdated.outputs.updateDoc
run: |
echo "commit_id=$(echo $(git rev-parse HEAD))" >> $GITHUB_ENV
echo "email=$(echo $(git log --pretty=format:"%ae" $commit_id))" >> $GITHUB_ENV
# - name: Set env variables
# if: steps.DocUpdated.outputs.updateDoc
# run: |
# echo "commit_id=$(echo $(git rev-parse HEAD))" >> $GITHUB_ENV
# echo "email=$(echo $(git log --pretty=format:"%ae" $commit_id))" >> $GITHUB_ENV

- name: Update Doc
if: steps.DocUpdated.outputs.updateDoc
run: |
Green='0;32'
NoColor='\033[0m'
git config --global user.name "${{github.actor}}"
git config --global user.email "${{env.email}}"
git add .
git commit -m "Update documentation"
git push
echo -e "🚀${Green} Hurrah! doc updated${NoColor}"
# - name: Update Doc
# if: steps.DocUpdated.outputs.updateDoc
# run: |
# Green='0;32'
# NoColor='\033[0m'
# git config --global user.name "${{github.actor}}"
# git config --global user.email "${{env.email}}"
# git add .
# git commit -m "Update documentation"
# git push
# echo -e "🚀${Green} Hurrah! doc updated${NoColor}"

- name: Create Documentation Artifact
uses: actions/upload-artifact@v2
with:
name: documentation-admin
path: talawa-admin-docs
# - name: Create Documentation Artifact
# uses: actions/upload-artifact@v2
# with:
# name: documentation-admin
# path: talawa-admin-docs

Copy-docs-to-talawa-docs:
needs: Generate-Documentation
Expand Down

0 comments on commit 46e17a2

Please sign in to comment.