Skip to content

Commit d5872c3

Browse files
authored
fix: call publish workflow from update cli (#168)
1 parent 30c583b commit d5872c3

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12+
# This gets called from the update-cli workflow
13+
workflow_call:
14+
1215
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1316
permissions:
1417
contents: read

.github/workflows/update-cli.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
build:
12+
update-cli:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Check out source
1616
uses: actions/checkout@v3
17-
- name: Check out documentation branch
18-
uses: actions/checkout@v3
19-
with:
20-
ref: 'dist'
21-
path: 'public'
2217
- name: Use Node.js
2318
uses: actions/setup-node@v3
2419
with:
@@ -44,26 +39,11 @@ jobs:
4439
git config user.name 'npm CLI robot'
4540
git config user.email '[email protected]'
4641
git commit -m 'CLI documentation update from CI'
47-
- name: Build documentation
48-
run: npm run build
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
- name: Push source changes
52-
if: steps.status.outputs.has_changes == '1'
53-
run: git push origin main
54-
- name: Check for changes to docs
55-
id: docs-status
56-
working-directory: public
57-
run: |
58-
if [ -n "$(git status --porcelain)" ]; then
59-
echo "::set-output name=has_changes::1"
60-
fi
61-
- name: Publish documentation
62-
if: steps.docs-status.outputs.has_changes == '1'
63-
working-directory: public
64-
run: |
65-
git add --verbose .
66-
git config user.name 'npm CLI robot'
67-
git config user.email '[email protected]'
68-
git commit -m 'CLI documentation update from CI'
69-
git push origin dist
42+
git push origin main
43+
44+
deploy:
45+
runs-on: ubuntu-latest
46+
needs: update-cli
47+
steps:
48+
- name: Call publish workflow
49+
uses: ./.github/workflows/publish.yml

0 commit comments

Comments
 (0)