Skip to content

Commit 20ce3ae

Browse files
authored
docs: setting cron for periodical update tutorials (#18783)
1 parent 9f17324 commit 20ce3ae

File tree

2 files changed

+82
-2
lines changed

2 files changed

+82
-2
lines changed

.github/workflows/_legacy-checkpoints.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,30 @@ jobs:
126126
runs-on: ubuntu-20.04
127127
if: inputs.create_pr
128128
needs: create-legacy-ckpts
129+
env:
130+
PL_VERSION: ${{ needs.create-legacy-ckpts.outputs.pl-version }}
129131
steps:
130132
- uses: actions/checkout@v4
131133
with:
132134
ref: master
133135

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

137140
- name: Create Pull Request
138141
uses: peter-evans/create-pull-request@v5
139142
with:
140-
title: Adding test for legacy checkpoint created with ${{ needs.create-legacy-ckpts.outputs.pl-version }}
143+
title: Adding test for legacy checkpoint created with ${{ env.PL_VERSION }}
144+
committer: GitHub <[email protected]>
145+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
146+
commit-message: "update tutorials to `${{ env.PL_VERSION }}`"
147+
body: "**This is automated addition of created checkpoints with the latest `lightning` release!**"
141148
delete-branch: true
142149
token: ${{ secrets.PAT_GHOST }}
143150
labels: |
144151
checkpointing
145152
tests
146153
pl
154+
assignees: borda
155+
reviewers: borda

.github/workflows/docs-tutorials.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Update tutorials
2+
3+
on:
4+
pull_request:
5+
branches: ["master"]
6+
paths:
7+
- ".github/workflows/docs-tutorials.yml"
8+
schedule:
9+
# on Sundays
10+
- cron: "0 0 * * 0"
11+
workflow_dispatch: {}
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
jobs:
18+
docs-update:
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: true
24+
fetch-depth: 0
25+
#lfs: true
26+
27+
- name: initial state
28+
run: |
29+
git submodule status
30+
# Skip smudge - We'll download binary files later in a faster batch
31+
git lfs install --skip-smudge
32+
- name: update submodules
33+
env:
34+
GIT_TRACE: 1
35+
run: |
36+
git submodule sync
37+
git submodule update --remote --force
38+
- name: final state
39+
run: |
40+
git submodule status
41+
git status
42+
43+
short_sha=$(git submodule status | grep -A 1 _notebooks | cut -c1-8)
44+
echo "SHA_SHORT=$short_sha" >> $GITHUB_ENV
45+
46+
- name: Create Pull Request
47+
if: github.event_name != 'pull_request'
48+
uses: peter-evans/create-pull-request@v5
49+
with:
50+
title: "docs: update ref to latest tutorials"
51+
committer: GitHub <[email protected]>
52+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
53+
token: ${{ secrets.PAT_GHOST }}
54+
add-paths: _notebooks
55+
commit-message: "update tutorials to `${{ env.SHA_SHORT }}`"
56+
branch: "docs/update-tutorials"
57+
# Delete the branch when closing pull requests, and when undeleted after merging.
58+
delete-branch: true
59+
# the PR's body/content
60+
body: >
61+
**This is automated update with the latest lighting tutorials!**
62+
The target commit in the [publication](https://github.com/Lightning-AI/tutorials/tree/publication)
63+
branch is [${{ env.SHA_SHORT }}](https://github.com/Lightning-AI/tutorials/commit/${{ env.SHA_SHORT }}).
64+
65+
Before proceeding further double check that the PR include only submodule's head update.
66+
Eventually some additional adjustments in lightning docs may be needed.
67+
labels: |
68+
docs
69+
examples
70+
assignees: borda
71+
reviewers: borda

0 commit comments

Comments
 (0)