From c0bf4a5c9035aea4c55fb3f5cb46b8c73327aacd Mon Sep 17 00:00:00 2001 From: Harshil Date: Wed, 22 Jan 2025 21:12:49 +0530 Subject: [PATCH] update pull-request.yml --- .github/workflows/pull-request.yml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e0c1675688..f19c083432 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -94,8 +94,9 @@ jobs: echo "Error: Close this PR and try again." exit 1 - generate-docs: - name: Update documentation + Update-Documentation: + if: github.ref == 'refs/heads/automated-docs' + name: Update Documentation runs-on: ubuntu-latest environment: TALAWA_ENVIRONMENT steps: @@ -117,9 +118,9 @@ jobs: flutter analyze dart analyze flutter pub global activate dartdoc - flutter pub global run dartdoc . --output docs/docs/auto-docs --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 + flutter pub global run dartdoc . --output docs/docs/auto-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 docs/docs/auto-docs/widgets_pinned_carousel_widget/CustomCarouselScrollerState/build.md + rm -rf docs/docs/auto-docs/widgets_post_widget/PostContainerState/build.md - uses: actions/upload-artifact@v3 with: name: docs @@ -157,6 +158,24 @@ jobs: git push echo -e "🚀${Green} Hurrah! doc updated${NoColor}" + Documentation-to-talawa-docs: + if: github.ref == 'refs/heads/develop-postgres' && ${{ github.actor != 'dependabot[bot]' }} + name: Export Documentation to Auto-Docs + runs-on: ubuntu-latest + needs: Update-Documentation + steps: + - uses: actions/checkout@v4 + - uses: dmnemec/copy_file_to_another_repo_action@v1.1.1 + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB_NEW }} + with: + source_file: "talawa-mobile-docs/" + destination_repo: "PalisadoesFoundation/talawa" + destination_folder: "docs/docs/auto-docs" + user_email: "${{env.email}}" + user_name: "${{github.actor}}" + commit_message: "Writing talawa-mobile-docs to auto-docs" + Branch-check: if: ${{ github.actor != 'dependabot[bot]' && !contains(github.event.pull_request.labels.*.name, 'ignore-sensitive-files-pr') }} name: "Base branch check"