Skip to content

Commit 9c05ec4

Browse files
committed
chore: refactor workflows
1 parent b454a27 commit 9c05ec4

File tree

2 files changed

+67
-65
lines changed

2 files changed

+67
-65
lines changed

.github/workflows/publish-docs.yml

Lines changed: 57 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
1-
name: Publish Doc
2-
3-
on: workflow_dispatch
4-
5-
permissions:
6-
contents: read
7-
pages: write
8-
id-token: write
9-
10-
concurrency:
11-
group: pages
12-
cancel-in-progress: false
13-
14-
jobs:
15-
build:
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v5
20-
with:
21-
fetch-depth: 0
22-
23-
- name: Setup Node
24-
uses: actions/setup-node@v5
25-
with:
26-
node-version: 22
27-
cache: npm
28-
cache-dependency-path: docs/package-lock.json
29-
- name: Setup Pages
30-
uses: actions/configure-pages@v5
31-
32-
- name: Install dependencies
33-
working-directory: docs
34-
run: npm ci
35-
36-
- name: Build with VitePress
37-
working-directory: docs
38-
run: npm run docs:build
39-
40-
- name: Upload artifact
41-
uses: actions/upload-pages-artifact@v4
42-
with:
43-
path: docs/.vitepress/dist
44-
45-
deploy:
46-
environment:
47-
name: github-pages
48-
url: ${{ steps.deployment.outputs.page_url }}
49-
needs: build
50-
runs-on: ubuntu-latest
51-
name: Deploy
52-
steps:
53-
- name: Deploy to GitHub Pages
54-
id: deployment
55-
uses: actions/deploy-pages@v4
1+
name: Publish Doc
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: false
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v5
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v5
27+
with:
28+
node-version: 22
29+
cache: npm
30+
cache-dependency-path: docs/package-lock.json
31+
- name: Setup Pages
32+
uses: actions/configure-pages@v5
33+
34+
- name: Install dependencies
35+
working-directory: docs
36+
run: npm ci
37+
38+
- name: Build with VitePress
39+
working-directory: docs
40+
run: npm run docs:build
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v4
44+
with:
45+
path: docs/.vitepress/dist
46+
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
needs: build
52+
runs-on: ubuntu-latest
53+
name: Deploy
54+
steps:
55+
- name: Deploy to GitHub Pages
56+
id: deployment
57+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
SUFFIX: ${{ needs.release-please.outputs.tag_name }}-${{ matrix.target }}
5151

5252
steps:
53-
- name: Checkout code
53+
- name: Checkout repository
5454
uses: actions/checkout@v4
5555

5656
- name: Install Rust toolchain
@@ -141,10 +141,10 @@ jobs:
141141
publish-crates:
142142
name: Publish Crates
143143
needs: [release-please, release-assets]
144-
if: ${{ needs.release-please.outputs.release_created }}
144+
if: needs.release-please.outputs.release_created == 'true'
145145
runs-on: ubuntu-latest
146146
steps:
147-
- name: Checkout code
147+
- name: Checkout repository
148148
uses: actions/checkout@v4
149149

150150
- name: Install Rust toolchain
@@ -167,10 +167,10 @@ jobs:
167167

168168
publish-docs:
169169
name: Publish Documentation
170-
needs: [release-please, release-assets, publish-crates]
171-
if: ${{ needs.release-please.outputs.release_created }}
172-
runs-on: ubuntu-latest
173-
steps:
174-
- run: gh workflow run publish-docs.yml
175-
env:
176-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170+
if: needs.release-please.outputs.release_created == 'true'
171+
needs: [release-please, release-assets]
172+
uses: decipher3114/resl/.github/workflows/publish-docs.yml@main
173+
permissions:
174+
contents: read
175+
pages: write
176+
id-token: write

0 commit comments

Comments
 (0)