|
1 | 1 | # Workflow for deploying docs static content to GitHub Pages. |
2 | | -name: Deploy static docs to Pages |
| 2 | +name: docs |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | push: |
@@ -32,35 +32,44 @@ jobs: |
32 | 32 | steps: |
33 | 33 | - name: Checkout |
34 | 34 | uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + fetch-depth: 2 |
35 | 37 |
|
36 | 38 | - name: Node.js |
37 | 39 | uses: actions/setup-node@v4 |
38 | 40 | with: |
39 | 41 | node-version: 22 |
40 | 42 |
|
41 | 43 | - name: Check if version has been updated |
42 | | - id: check |
| 44 | + id: versionCheck |
43 | 45 | uses: EndBug/version-check@v2 |
| 46 | + with: |
| 47 | + file-url: 'https://unpkg.com/${{ github.event.repository.name }}@latest/package.json' |
| 48 | + static-checking: localIsNew |
44 | 49 |
|
45 | 50 | - name: Log when version has changed |
46 | | - if: steps.check.outputs.changed == 'true' |
47 | | - run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"' |
| 51 | + if: steps.versionCheck.outputs.changed == 'true' |
| 52 | + run: 'echo "Version changed, new version: ${{ steps.versionCheck.outputs.version }} (${{ steps.versionCheck.outputs.type }})"' |
48 | 53 |
|
49 | 54 | - name: Log when version has not changed |
50 | | - if: steps.check.outputs.changed == 'false' |
51 | | - run: 'echo "No version change"' |
| 55 | + if: steps.versionCheck.outputs.changed == 'false' |
| 56 | + run: 'echo "Version did not change"' |
52 | 57 |
|
53 | | - # - name: npm ci |
54 | | - # run: npm ci --foreground-scripts |
| 58 | + - name: npm ci |
| 59 | + if: steps.versionCheck.outputs.changed == 'true' |
| 60 | + run: npm ci --foreground-scripts |
55 | 61 |
|
56 | | - # - name: npm run docs |
57 | | - # run: npm run docs |
| 62 | + - name: npm run docs |
| 63 | + if: steps.versionCheck.outputs.changed == 'true' |
| 64 | + run: npm run docs |
58 | 65 |
|
59 | | - # - name: Upload artifact |
60 | | - # uses: actions/upload-pages-artifact@v3 |
61 | | - # with: |
62 | | - # path: docs/ |
| 66 | + - name: Upload docs |
| 67 | + if: steps.versionCheck.outputs.changed == 'true' |
| 68 | + uses: actions/upload-pages-artifact@v3 |
| 69 | + with: |
| 70 | + path: docs/ |
63 | 71 |
|
64 | | - # - name: Deploy to GitHub Pages |
65 | | - # id: deployment |
66 | | - # uses: actions/deploy-pages@v4 |
| 72 | + - name: Deploy docs to GitHub Pages |
| 73 | + if: steps.versionCheck.outputs.changed == 'true' |
| 74 | + id: deployment |
| 75 | + uses: actions/deploy-pages@v4 |
0 commit comments