|
| 1 | +name: Generate vim help |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + |
| 7 | +concurrency: vimdoc-ja-deploy |
| 8 | + # global concurrency limit access to vim-jp/vimdoc-ja per workflow |
| 9 | + |
| 10 | +jobs: |
| 11 | + generate: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: checkout master |
| 15 | + uses: actions/checkout@v2 |
| 16 | + with: |
| 17 | + path: work |
| 18 | + - name: Checkout vimdoc-ja |
| 19 | + uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + path: target |
| 22 | + repository: 'vim-jp/vimdoc-ja' |
| 23 | + ssh-key: ${{ secrets.VIMDOC_JA_SSH_KEY }} |
| 24 | + - name: Setup Vim |
| 25 | + uses: thinca/action-setup-vim@v1 |
| 26 | + with: |
| 27 | + vim_version: 'v8.2.0020' |
| 28 | + vim_type: 'Vim' |
| 29 | + - name: Generate new document |
| 30 | + run: | |
| 31 | + cd work |
| 32 | + # Create tags |
| 33 | + vim -eu tools/maketags.vim |
| 34 | +
|
| 35 | + cd .. |
| 36 | + - name: Update target |
| 37 | + run: | |
| 38 | + cd target |
| 39 | + # update latest |
| 40 | + git pull --rebase |
| 41 | + cd .. |
| 42 | + - name: Install new document |
| 43 | + run: | |
| 44 | + # install |
| 45 | + rsync -rlptD --delete-after work/doc/ target/doc |
| 46 | + rsync -rlptD --delete-after work/syntax/ target/syntax |
| 47 | + rsync -rlptD --delete-after work/README-dist.md target/README.md |
| 48 | + - name: Commit updated master branch |
| 49 | + uses: EndBug/add-and-commit@v7 |
| 50 | + with: |
| 51 | + cwd: './target' |
| 52 | + default_author: github_actions |
| 53 | + message: |- |
| 54 | + Generated by GitHub workflow ${{ github.run_id }} |
| 55 | +
|
| 56 | + https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 57 | + branch: master |
| 58 | + pull: 'NO-PULL' |
| 59 | + |
| 60 | + deploy: |
| 61 | + runs-on: ubuntu-latest |
| 62 | + needs: generate |
| 63 | + # "deploy" update vimdoc-ja/gh-pages branch |
| 64 | + # work after "generate" to updated vimdoc-ja/master branch |
| 65 | + # parallel work conflict vimdoc-ja repo status |
| 66 | + steps: |
| 67 | + - name: checkout master |
| 68 | + uses: actions/checkout@v2 |
| 69 | + with: |
| 70 | + path: work |
| 71 | + - name: Checkout vimdoc-ja |
| 72 | + uses: actions/checkout@v2 |
| 73 | + with: |
| 74 | + path: target |
| 75 | + repository: 'vim-jp/vimdoc-ja' |
| 76 | + ssh-key: ${{ secrets.VIMDOC_JA_SSH_KEY }} |
| 77 | + ref: gh-pages |
| 78 | + - name: Setup Vim |
| 79 | + uses: thinca/action-setup-vim@v1 |
| 80 | + with: |
| 81 | + vim_version: 'v8.2.0020' |
| 82 | + vim_type: 'Vim' |
| 83 | + - name: Generate new document |
| 84 | + run: | |
| 85 | + cd work |
| 86 | + # Create html documents |
| 87 | + make html |
| 88 | +
|
| 89 | + cd .. |
| 90 | + - name: Update target |
| 91 | + run: | |
| 92 | + cd target |
| 93 | + # update latest |
| 94 | + git pull --rebase |
| 95 | + cd .. |
| 96 | + - name: Install new document |
| 97 | + run: | |
| 98 | + # install |
| 99 | + cp work/target/html/doc/*.html target |
| 100 | + - name: Commit updated master branch |
| 101 | + uses: EndBug/add-and-commit@v7 |
| 102 | + with: |
| 103 | + cwd: './target' |
| 104 | + default_author: github_actions |
| 105 | + message: |- |
| 106 | + Generated by GitHub workflow ${{ github.run_id }} |
| 107 | +
|
| 108 | + https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 109 | + branch: gh-pages |
| 110 | + pull: 'NO-PULL' |
0 commit comments