|
1 | 1 | name: Build and optionally deploy scripts/docs
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: |
6 |
| - - 'master' |
7 |
| - pull_request: |
8 |
| - branches: |
9 |
| - - 'master' |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "master" |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - "master" |
10 | 10 |
|
11 | 11 | jobs:
|
12 |
| - deploy: |
13 |
| - runs-on: ubuntu-latest |
14 |
| - steps: |
15 |
| - - name: Checkout this repository |
16 |
| - uses: actions/checkout@v4 |
17 |
| - with: |
18 |
| - persist-credentials: false |
19 |
| - fetch-depth: 0 |
20 |
| - path: './lua' |
21 |
| - - run: 'rm -f ./lua/dist/*' |
22 |
| - - name: Checkout docs website repository |
23 |
| - if: github.event_name == 'push' |
24 |
| - uses: actions/checkout@v4 |
25 |
| - with: |
26 |
| - persist-credentials: false |
27 |
| - fetch-depth: 0 |
28 |
| - repository: finale-lua/jw-lua-scripts-docs |
29 |
| - path: './website' |
30 |
| - token: ${{ secrets.NICK_PERSONAL_TOKEN }} |
31 |
| - - name: build scripts |
32 |
| - uses: ./lua/.github/actions/bundle |
33 |
| - with: |
34 |
| - source: ./lua/src |
35 |
| - output: ./lua/dist |
36 |
| - - name: build hashes |
37 |
| - run: | |
38 |
| - rm -rf ./lua/hash |
39 |
| - mkdir ./lua/hash |
40 |
| - cd ./lua/dist |
41 |
| - for file in *; do sha512sum "$file" > "../hash/$(basename "$file" .lua).hash"; done |
42 |
| - cd ../../ |
43 |
| - - name: parse scripts |
44 |
| - uses: ./lua/.github/actions/get-metadata |
45 |
| - with: |
46 |
| - source: ./lua/src |
47 |
| - output: ./website/src/lib/lib/script-data.json |
48 |
| - - name: Generate the docs |
49 |
| - uses: finale-lua/[email protected].2 |
50 |
| - with: |
51 |
| - input: './lua/src/library' |
52 |
| - repositoryUrl: 'https://github.com/finale-lua/lua-scripts/tree/${{ github.ref }}/src/library' |
53 |
| - output: './lua/docs/library' |
54 |
| - - name: Generate the docs |
55 |
| - uses: finale-lua/[email protected].2 |
56 |
| - with: |
57 |
| - input: './lua/src/mixin' |
58 |
| - repositoryUrl: 'https://github.com/finale-lua/lua-scripts/tree/${{ github.ref }}/src/mixin' |
59 |
| - output: './lua/docs/mixin' |
60 |
| - - run: 'rm -rf website/docs' |
61 |
| - - run: 'cp -R lua/docs website/docs' |
62 |
| - - name: Commit & Push docs to website |
63 |
| - if: github.event_name == 'push' |
64 |
| - uses: actions-js/[email protected] |
65 |
| - with: |
66 |
| - github_token: ${{ secrets.NICK_PERSONAL_TOKEN }} |
67 |
| - directory: website |
68 |
| - branch: main |
69 |
| - repository: finale-lua/jw-lua-scripts-docs |
70 |
| - - name: Commit & Push docs to this repo |
71 |
| - if: github.event_name == 'push' |
72 |
| - uses: actions-js/[email protected] |
73 |
| - with: |
74 |
| - github_token: ${{ secrets.NICK_PERSONAL_TOKEN }} |
75 |
| - directory: lua |
76 |
| - branch: ${{ github.ref }} |
| 12 | + deploy: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout this repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + persist-credentials: false |
| 19 | + fetch-depth: 0 |
| 20 | + path: "./lua" |
| 21 | + - run: "rm -f ./lua/dist/*" |
| 22 | + - name: Checkout docs website repository |
| 23 | + if: github.event_name == 'push' |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + persist-credentials: false |
| 27 | + fetch-depth: 0 |
| 28 | + repository: finale-lua/jw-lua-scripts-docs |
| 29 | + path: "./website" |
| 30 | + token: ${{ secrets.NICK_PERSONAL_TOKEN }} |
| 31 | + - name: build scripts |
| 32 | + uses: ./lua/.github/actions/bundle |
| 33 | + with: |
| 34 | + source: ./lua/src |
| 35 | + output: ./lua/dist |
| 36 | + - name: build hashes |
| 37 | + run: | |
| 38 | + rm -rf ./lua/hash |
| 39 | + mkdir ./lua/hash |
| 40 | + cd ./lua/dist |
| 41 | + for file in *; do sha512sum "$file" > "../hash/$(basename "$file" .lua).hash"; done |
| 42 | + cd ../../ |
| 43 | + - name: parse scripts |
| 44 | + uses: ./lua/.github/actions/get-metadata |
| 45 | + with: |
| 46 | + source: ./lua/src |
| 47 | + output: ./website/src/lib/lib/script-data.json |
| 48 | + - name: Generate the docs |
| 49 | + uses: finale-lua/[email protected].3 |
| 50 | + with: |
| 51 | + input: "./lua/src/library" |
| 52 | + repositoryUrl: "https://github.com/finale-lua/lua-scripts/tree/${{ github.ref }}/src/library" |
| 53 | + output: "./lua/docs/library" |
| 54 | + - name: Generate the docs |
| 55 | + uses: finale-lua/[email protected].3 |
| 56 | + with: |
| 57 | + input: "./lua/src/mixin" |
| 58 | + repositoryUrl: "https://github.com/finale-lua/lua-scripts/tree/${{ github.ref }}/src/mixin" |
| 59 | + output: "./lua/docs/mixin" |
| 60 | + - run: "rm -rf website/docs" |
| 61 | + - run: "cp -R lua/docs website/docs" |
| 62 | + - name: Commit & Push docs to website |
| 63 | + if: github.event_name == 'push' |
| 64 | + uses: actions-js/[email protected] |
| 65 | + with: |
| 66 | + github_token: ${{ secrets.NICK_PERSONAL_TOKEN }} |
| 67 | + directory: website |
| 68 | + branch: main |
| 69 | + repository: finale-lua/jw-lua-scripts-docs |
| 70 | + - name: Commit & Push docs to this repo |
| 71 | + if: github.event_name == 'push' |
| 72 | + uses: actions-js/[email protected] |
| 73 | + with: |
| 74 | + github_token: ${{ secrets.NICK_PERSONAL_TOKEN }} |
| 75 | + directory: lua |
| 76 | + branch: ${{ github.ref }} |
0 commit comments