Skip to content

Commit

Permalink
Documentation: Create a github workflow to fetch docs from talawa mob…
Browse files Browse the repository at this point in the history
…ile app (#867)

* workflow added

* workflow added1
  • Loading branch information
gautam-divyanshu authored Sep 28, 2024
1 parent 2dde847 commit 06a7464
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pull-docs-talawa.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Clone the Talawa repo
git clone --depth=1 --branch develop https://github.com/PalisadoesFoundation/talawa.git

# Create a folder for Talawa mobile docs
mkdir -p docs/talawa-mobile-docs

# Navigate into the Talawa repo
cd talawa

# Install Flutter dependencies and generate the docs
flutter pub get
flutter pub global activate dartdoc
flutter pub global run dartdoc . --output talawa-mobile-docs --format md --exclude=test/widget_tests/widgets/pinned_carousel_widget_test.dart, lib/widgets/pinned_carousel_widget.dart, lib/widgets/post_widget.dart, test/widget_tests/widgets/post_widget_test.dart
rm -rf talawa-mobile-docs/widgets_pinned_carousel_widget/CustomCarouselScrollerState/build.md
rm -rf talawa-mobile-docs/widgets_post_widget/PostContainerState/build.md

# Navigate back and copy the generated docs
cd ..
cp -r talawa/talawa-mobile-docs/* docs/talawa-mobile-docs/

# Remove the cloned Talawa repo
rm -rf talawa

# Commit and push the changes
git add .
git commit -m "Updated Talawa mobile docs"
git pull --rebase origin develop
git push -u origin develop
24 changes: 24 additions & 0 deletions .github/workflows/pull-talawa-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Talawa Mobile Changes

on:
schedule:
- cron: '0 0 * * 0' # Runs every Sunday at midnight
workflow_dispatch:

jobs:
pull:
runs-on: ubuntu-latest

steps:
- name: Checkout current repository
uses: actions/checkout@v2

- name: Set up Git config
run: |
git config --global user.email "${{ env.email }}"
git config --global user.name "${{ github.actor }}"
- name: Run bash script to fetch Talawa mobile docs
run: bash .github/workflows/pull-docs-talawa.sh
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

0 comments on commit 06a7464

Please sign in to comment.