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