|
| 1 | +name: test |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + |
| 7 | +jobs: |
| 8 | + test: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v4 |
| 12 | + - uses: actions/setup-node@v4 |
| 13 | + with: |
| 14 | + node-version: 20 |
| 15 | + |
| 16 | + - run: npm install |
| 17 | + - run: npm run build |
| 18 | + - run: mkdir -p build |
| 19 | + |
| 20 | + - name: Output src/ folder tree |
| 21 | + # uses: jaywcjlove/github-action-folder-tree@main |
| 22 | + uses: ./ |
| 23 | + with: |
| 24 | + path: ./src |
| 25 | + |
| 26 | + - name: Create idoc config |
| 27 | + run: | |
| 28 | + cat > idoc.yml << EOF |
| 29 | + site: "Folder Tree {{version}}" |
| 30 | + menus: |
| 31 | + Home: index.html |
| 32 | + Sponsor: https://jaywcjlove.github.io/#/sponsor |
| 33 | + footer: | |
| 34 | + <a href="https://jaywcjlove.github.io/#/sponsor" target="_blank">Sponsor</a> • |
| 35 | + <a href="https://jaywcjlove.github.io/changelog-generator" target="_blank">Changelog Generator</a> • |
| 36 | + <a href="https://jaywcjlove.github.io/create-tag-action" target="_blank">Create Tag</a> • |
| 37 | + <a href="https://jaywcjlove.github.io/github-action-contributors" target="_blank">Contributors</a> • |
| 38 | + <a href="https://jaywcjlove.github.io/generated-badges" target="_blank">Generated Badges</a> |
| 39 | + <br /> |
| 40 | + Released under the MIT License. Copyright © {{idocYear}} Kenny Wong<br /> |
| 41 | + Generated by <a href="https://github.com/jaywcjlove/idoc" target="_blank">idoc</a> v{{idocVersion}} |
| 42 | + |
| 43 | + EOF |
| 44 | +
|
| 45 | + - run: npm install idoc@1 -g |
| 46 | + - run: idoc |
| 47 | + - name: gh-pages README.md |
| 48 | + working-directory: dist |
| 49 | + run: | |
| 50 | + cat > README.md << EOF |
| 51 | + Website: https://jaywcjlove.github.io/github-action-folder-tree |
| 52 | + EOF |
| 53 | +
|
| 54 | + - name: Is a tag/release created auto? |
| 55 | + id: create_tag |
| 56 | + uses: jaywcjlove/create-tag-action@main |
| 57 | + with: |
| 58 | + # test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' |
| 59 | + package-path: ./package.json |
| 60 | + |
| 61 | + - name: get tag version |
| 62 | + id: tag_version |
| 63 | + uses: jaywcjlove/changelog-generator@main |
| 64 | + |
| 65 | + - name: Deploy |
| 66 | + uses: peaceiris/actions-gh-pages@v4 |
| 67 | + with: |
| 68 | + commit_message: ${{steps.tag_version.outputs.tag}} ${{ github.event.head_commit.message }} |
| 69 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + publish_dir: ./dist |
| 71 | + |
| 72 | + - name: Generate Changelog |
| 73 | + id: changelog |
| 74 | + uses: jaywcjlove/changelog-generator@main |
| 75 | + with: |
| 76 | + head-ref: ${{steps.create_tag.outputs.version}} |
| 77 | + filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' |
| 78 | + |
| 79 | + - name: Create Release |
| 80 | + uses: jaywcjlove/create-tag-action@main |
| 81 | + with: |
| 82 | + # test: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}' |
| 83 | + package-path: ./package.json |
| 84 | + release: true |
| 85 | + body: | |
| 86 | + [](https://jaywcjlove.github.io/#/sponsor) |
| 87 | + Documentation ${{ steps.changelog.outputs.tag }}: https://raw.githack.com/jaywcjlove/github-action-folder-tree/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html |
| 88 | + Comparing Changes: ${{ steps.changelog.outputs.compareurl }} |
| 89 | +
|
| 90 | + ${{ steps.changelog.outputs.changelog }} |
| 91 | +
|
| 92 | +
|
| 93 | + ```yml |
| 94 | + - name: Read README.md |
| 95 | + id: package |
| 96 | + uses: jaywcjlove/github-action-folder-tree@main |
| 97 | + with: |
| 98 | + path: package.json |
| 99 | +
|
| 100 | + - name: Echo package.json |
| 101 | + run: echo "$\{{ steps.package.outputs.content }}" |
| 102 | + ``` |
| 103 | +
|
0 commit comments