From 20ecc519da30a73345cafff9c1732dd2540e692c Mon Sep 17 00:00:00 2001 From: gautam-divyanshu Date: Mon, 23 Sep 2024 22:55:42 +0530 Subject: [PATCH 1/2] workflow added --- .github/workflows/pull-docs-talawa.sh | 30 ++++++++++++++++++++++++++ .github/workflows/pull-talawa-docs.yml | 24 +++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/pull-docs-talawa.sh create mode 100644 .github/workflows/pull-talawa-docs.yml diff --git a/.github/workflows/pull-docs-talawa.sh b/.github/workflows/pull-docs-talawa.sh new file mode 100644 index 00000000000..d2b5fb14d0e --- /dev/null +++ b/.github/workflows/pull-docs-talawa.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Clone the Talawa repo +git clone --depth=1 --branch develop https://github.com/gautam-divyanshu/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 diff --git a/.github/workflows/pull-talawa-docs.yml b/.github/workflows/pull-talawa-docs.yml new file mode 100644 index 00000000000..457adb19a07 --- /dev/null +++ b/.github/workflows/pull-talawa-docs.yml @@ -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 }} From 509454da6d87561884ab692f38ed11c9cfbb5ff7 Mon Sep 17 00:00:00 2001 From: gautam-divyanshu Date: Tue, 24 Sep 2024 11:30:48 +0530 Subject: [PATCH 2/2] workflow added1 --- .github/workflows/pull-docs-talawa.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-docs-talawa.sh b/.github/workflows/pull-docs-talawa.sh index d2b5fb14d0e..afb214c581f 100644 --- a/.github/workflows/pull-docs-talawa.sh +++ b/.github/workflows/pull-docs-talawa.sh @@ -1,7 +1,7 @@ #!/bin/bash # Clone the Talawa repo -git clone --depth=1 --branch develop https://github.com/gautam-divyanshu/talawa.git +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