pytorch-lightning

Форк
0
/
docs-tutorials.yml 
75 строк · 2.5 Кб
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
          # starting from second char as the line starts with +
31
          short_sha=$(git submodule status | grep -A 1 _notebooks | cut -c2-9)
32
          echo "SHA_ACTUAL=$short_sha" >> $GITHUB_ENV
33
          # Skip smudge - We'll download binary files later in a faster batch
34
          git lfs install --skip-smudge
35
      - name: update submodules
36
        env:
37
          GIT_TRACE: 1
38
        run: |
39
          git submodule sync
40
          git submodule update --remote --force
41
      - name: final state
42
        run: |
43
          git submodule status
44
          git status
45
          # starting from second char as the line starts with +
46
          short_sha=$(git submodule status | grep -A 1 _notebooks | cut -c2-9)
47
          echo "SHA_LATEST=$short_sha" >> $GITHUB_ENV
48

49
      - name: Create Pull Request
50
        if: ${{ github.event_name != 'pull_request' && env.SHA_ACTUAL != env.SHA_LATEST }}
51
        uses: peter-evans/create-pull-request@v6
52
        with:
53
          title: "docs: update ref to latest tutorials"
54
          committer: GitHub <noreply@github.com>
55
          author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
56
          token: ${{ secrets.PAT_GHOST }}
57
          add-paths: _notebooks
58
          commit-message: "update tutorials to `${{ env.SHA_LATEST }}`"
59
          branch: "docs/update-tutorials"
60
          # Delete the branch when closing pull requests, and when undeleted after merging.
61
          delete-branch: true
62
          # the PR's body/content
63
          body: >
64
            **This is automated update with the latest lighting tutorials!**
65

66
            The target commit in the [publication](https://github.com/Lightning-AI/tutorials/tree/publication)
67
             branch is [${{ env.SHA_LATEST }}](https://github.com/Lightning-AI/tutorials/commit/${{ env.SHA_LATEST }}).
68

69
            Before proceeding further double check that the PR include only submodule's head update.
70
            Eventually some additional adjustments in lightning docs may be needed.
71
          labels: |
72
            docs
73
            examples
74
          assignees: borda
75
          reviewers: borda
76

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.