From 1a5119a43df29e26770016fc63a14ae6d816ca36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Thu, 5 Dec 2024 12:33:04 +0100 Subject: [PATCH 1/2] Add True to video metadata if recordings --- sources/bin/extract_gtn_tutorials.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/bin/extract_gtn_tutorials.py b/sources/bin/extract_gtn_tutorials.py index 0c66e486..07f71077 100644 --- a/sources/bin/extract_gtn_tutorials.py +++ b/sources/bin/extract_gtn_tutorials.py @@ -116,8 +116,10 @@ def get_youtube_stats(tuto: dict) -> None: recordings = [] if "recordings" in tuto and tuto["recordings"]: recordings = tuto["recordings"] + tuto["video"] = True elif "slides_recordings" in tuto and tuto["slides_recordings"]: recordings = tuto["slides_recordings"] + tuto["video"] = True tuto["video_versions"] = len(recordings) for v in recordings: url = f"https://www.youtube.com/watch?v={v['youtube_id']}" From 357a77a362e9f9101692b8499d933c8e7aed1b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A9r=C3=A9nice=20Batut?= Date: Thu, 5 Dec 2024 12:40:31 +0100 Subject: [PATCH 2/2] Move tutorial fetch to different job in fetch GH workflow --- .github/workflows/fetch_filter_resources.yaml | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fetch_filter_resources.yaml b/.github/workflows/fetch_filter_resources.yaml index b5aced85..65dc2189 100644 --- a/.github/workflows/fetch_filter_resources.yaml +++ b/.github/workflows/fetch_filter_resources.yaml @@ -70,9 +70,34 @@ jobs: with: name: tools-${{ matrix.subset }} path: communities/all/resources/${{ matrix.subset }}_tools.* + fetch-tutorials: + runs-on: ubuntu-20.04 + name: Fetch tutorials + steps: + - name: Checkout main + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install requirement + run: | + python -m pip install -r requirements.txt + sudo apt-get install jq + - name: Fetch all tutorials + run: | + bash sources/bin/extract_all_tutorials.sh + env: + PLAUSIBLE_API_KEY: ${{ secrets.PLAUSIBLE_API_TOKEN }} + - name: Archive tutorials artifacts + uses: actions/upload-artifact@v4 + with: + name: tutorials + path: communities/all/resources/tutorials.json merge-fetch-filter: runs-on: ubuntu-20.04 - needs: fetch-tools-stepwise + needs: + - fetch-tools-stepwise + - fetch-tutorials name: Merge tools, fetch tutorials and filter the resources for communities steps: - name: Checkout main @@ -90,6 +115,12 @@ jobs: pattern: tools-* merge-multiple: true path: communities/all/resources/ + - name: Download stepwise tool lists + uses: actions/download-artifact@v4 + with: + pattern: tutorials + merge-multiple: true + path: communities/all/resources/ - name: Display structure of downloaded files run: ls -R communities/all/resources/ - name: Merge all tools @@ -107,11 +138,6 @@ jobs: - name: Filter workflows for communities run: | bash sources/bin/get_community_workflows.sh - - name: Fetch all tutorials - run: | - bash sources/bin/extract_all_tutorials.sh - env: - PLAUSIBLE_API_KEY: ${{ secrets.PLAUSIBLE_API_TOKEN }} - name: Filter tutorials for communities run: | bash sources/bin/get_community_tutorials.sh