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 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']}"