Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Create a github workflow to fetch docs from talawa mobile app #867

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Loading