Skip to content

Commit 226f6c5

Browse files
committed
Publish pages workflow: fix build
* Wait on a single job for package publish success (avoids spamming github api) * Use new package.json script commands
1 parent 30295d2 commit 226f6c5

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/pages-publish.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ env:
1616
NODE_VERSION: 20
1717

1818
jobs:
19-
build-docs:
20-
name: Generate site
19+
wait-for-package-publish:
20+
name: Wait for package publish workflow success
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 5
2323

@@ -30,6 +30,13 @@ jobs:
3030
repo-token: ${{ secrets.GITHUB_TOKEN }}
3131
wait-interval: 10
3232

33+
build-docs:
34+
name: Generate site
35+
needs: [wait-for-package-publish]
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 5
38+
39+
steps:
3340
- uses: actions/checkout@v4
3441

3542
- name: Remove README.md index lines
@@ -48,10 +55,10 @@ jobs:
4855
key: ${{ runner.os }}}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('package.json') }}
4956

5057
- name: Install dependencies
51-
run: npm install
58+
run: npm run clean-install
5259

53-
- name: Build alpine-typescript
54-
run: npm run docs-ci
60+
- name: Build alpine-typescript docs
61+
run: npm run docs-dist
5562

5663
- name: Copy favicon to /docs-build
5764
run: |
@@ -64,18 +71,11 @@ jobs:
6471

6572
build-example:
6673
name: Generate example site
74+
needs: [wait-for-package-publish]
6775
runs-on: ubuntu-latest
6876
timeout-minutes: 5
6977

7078
steps:
71-
- name: Wait for publish success
72-
uses: lewagon/wait-on-check-action@v1.3.1
73-
with:
74-
ref: ${{ github.ref }}
75-
check-name: Publish to npm registry
76-
repo-token: ${{ secrets.GITHUB_TOKEN }}
77-
wait-interval: 10
78-
7979
- uses: actions/checkout@v3
8080
with:
8181
sparse-checkout: |
@@ -103,10 +103,10 @@ jobs:
103103
key: ${{ runner.os }}}-${{ env.NODE_VERSION }}-node_modules-${{ hashFiles('package.json') }}
104104

105105
- name: Install dependencies
106-
run: npm install
106+
run: npm clean-install
107107

108108
- name: Build example project
109-
run: npm run build-ci
109+
run: npm run build-dist
110110

111111
- uses: actions/upload-artifact@v3
112112
with:

0 commit comments

Comments
 (0)