Skip to content

Commit

Permalink
docs: setting cron for periodical update tutorials (#18783)
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Oct 12, 2023
1 parent 9f17324 commit 20ce3ae
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/_legacy-checkpoints.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,30 @@ jobs:
runs-on: ubuntu-20.04
if: inputs.create_pr
needs: create-legacy-ckpts
env:
PL_VERSION: ${{ needs.create-legacy-ckpts.outputs.pl-version }}
steps:
- uses: actions/checkout@v4
with:
ref: master

- name: Append a new version to legacy checkpoint list
run: echo ${{ needs.create-legacy-ckpts.outputs.pl-version }} >> ${{ env.legacy_dir }}/back-compatible-versions.txt
working-directory: ${{ env.legacy_dir }}
run: echo ${PL_VERSION} >> back-compatible-versions.txt

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: Adding test for legacy checkpoint created with ${{ needs.create-legacy-ckpts.outputs.pl-version }}
title: Adding test for legacy checkpoint created with ${{ env.PL_VERSION }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
commit-message: "update tutorials to `${{ env.PL_VERSION }}`"
body: "**This is automated addition of created checkpoints with the latest `lightning` release!**"
delete-branch: true
token: ${{ secrets.PAT_GHOST }}
labels: |
checkpointing
tests
pl
assignees: borda
reviewers: borda
71 changes: 71 additions & 0 deletions .github/workflows/docs-tutorials.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Update tutorials

on:
pull_request:
branches: ["master"]
paths:
- ".github/workflows/docs-tutorials.yml"
schedule:
# on Sundays
- cron: "0 0 * * 0"
workflow_dispatch: {}

defaults:
run:
shell: bash

jobs:
docs-update:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
#lfs: true

- name: initial state
run: |
git submodule status
# Skip smudge - We'll download binary files later in a faster batch
git lfs install --skip-smudge
- name: update submodules
env:
GIT_TRACE: 1
run: |
git submodule sync
git submodule update --remote --force
- name: final state
run: |
git submodule status
git status
short_sha=$(git submodule status | grep -A 1 _notebooks | cut -c1-8)
echo "SHA_SHORT=$short_sha" >> $GITHUB_ENV
- name: Create Pull Request
if: github.event_name != 'pull_request'
uses: peter-evans/create-pull-request@v5
with:
title: "docs: update ref to latest tutorials"
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
token: ${{ secrets.PAT_GHOST }}
add-paths: _notebooks
commit-message: "update tutorials to `${{ env.SHA_SHORT }}`"
branch: "docs/update-tutorials"
# Delete the branch when closing pull requests, and when undeleted after merging.
delete-branch: true
# the PR's body/content
body: >
**This is automated update with the latest lighting tutorials!**
The target commit in the [publication](https://github.com/Lightning-AI/tutorials/tree/publication)
branch is [${{ env.SHA_SHORT }}](https://github.com/Lightning-AI/tutorials/commit/${{ env.SHA_SHORT }}).
Before proceeding further double check that the PR include only submodule's head update.
Eventually some additional adjustments in lightning docs may be needed.
labels: |
docs
examples
assignees: borda
reviewers: borda

0 comments on commit 20ce3ae

Please sign in to comment.