Skip to content
Merged
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
21 changes: 19 additions & 2 deletions .github/workflows/upload-notebook-to-git-tag.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Convert Notebooks to Python Scripts
name: Upload Converted Notebooks to Git Tag
on:
push:
branches:
- main
tags:
- "v**"
workflow_dispatch:

jobs:
convert-and-upload:
Expand Down Expand Up @@ -41,16 +44,30 @@ jobs:
tar -czf $RUNNER_TEMP/converted_notebooks.tar.gz -C $RUNNER_TEMP converted_notebooks
echo "output_path=$RUNNER_TEMP/converted_notebooks.tar.gz" >> $GITHUB_OUTPUT

# We use a mutable git tag / github release called `converted-notebooks` to always point to the latest converted notebooks
# For versioned git tags (e.g., v1.0.0), we create a corresponding github release with the converted notebooks

- name: Create Release for Tagged Notebooks
if: github.ref_type == 'tag'
uses: softprops/[email protected]
with:
files: ${{ steps.convert-notebooks.outputs.output_path }}
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# For pushes to `main`, we use a mutable git tag / github release called `converted-notebooks` to always point to the latest converted notebooks

- name: Update Converted Notebooks git tag
if: github.ref_type == 'branch'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag -f converted-notebooks
git push origin converted-notebooks --force

- name: Update Converted Notebooks Github Release
if: github.ref_type == 'branch'
uses: softprops/[email protected]
with:
files: ${{ steps.convert-notebooks.outputs.output_path }}
Expand Down