forked from Lightning-AI/pytorch-lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (68 loc) · 2.54 KB
/
docs-tutorials.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
# starting from second char as the line starts with +
short_sha=$(git submodule status | grep -A 1 _notebooks | cut -c2-9)
echo "SHA_ACTUAL=$short_sha" >> $GITHUB_ENV
# 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
# starting from second char as the line starts with +
short_sha=$(git submodule status | grep -A 1 _notebooks | cut -c2-9)
echo "SHA_LATEST=$short_sha" >> $GITHUB_ENV
- name: Create Pull Request
if: ${{ github.event_name != 'pull_request' && env.SHA_ACTUAL != env.SHA_LATEST }}
uses: peter-evans/create-pull-request@v6
with:
title: "docs: update ref to latest tutorials"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
token: ${{ secrets.PAT_GHOST }}
add-paths: _notebooks
commit-message: "update tutorials to `${{ env.SHA_LATEST }}`"
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_LATEST }}](https://github.com/Lightning-AI/tutorials/commit/${{ env.SHA_LATEST }}).
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