Skip to content

Commit d193a5a

Browse files
shenxianpeng2bndy5
andauthored
Refactor existing workflows to use reusable workflows (#194)
* Refactor existing workflows to use reusable workflows * Refactor existing workflows to use reusable workflows * Update job names * Update .github/workflows/mkdocs-deploy.yml Co-authored-by: Brendan <[email protected]> * Update workflows to point main branch --------- Co-authored-by: Brendan <[email protected]>
1 parent 98025a1 commit d193a5a

File tree

3 files changed

+7
-35
lines changed

3 files changed

+7
-35
lines changed

.github/workflows/mkdocs-deploy.yml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,5 @@ on:
55
workflow_dispatch:
66

77
jobs:
8-
build:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-python@v5
13-
with:
14-
python-version: 3.x
15-
- name: Install python action for doc extraction
16-
run: pip install -r docs/requirements.txt
17-
- name: check mkdocs build
18-
if: github.ref != 'refs/heads/main'
19-
run: mkdocs build
20-
- name: Build docs and deploy to gh-pages
21-
if: github.ref == 'refs/heads/main'
22-
run: |
23-
git config user.name 'github-actions'
24-
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
25-
mkdocs gh-deploy --force
8+
build-docs:
9+
uses: cpp-linter/.github/.github/workflows/mkdocs.yml@main

.github/workflows/release-drafter.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,5 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
update_release_draft:
11-
runs-on: ubuntu-latest
12-
steps:
13-
# Draft your next Release notes as Pull Requests are merged into the default branch
14-
- uses: release-drafter/release-drafter@v6
15-
env:
16-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
draft-release:
11+
uses: cpp-linter/.github/.github/workflows/release-drafter.yml@main

.github/workflows/run-pre-commit.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
name: Pre-commit
1+
name: Run pre-commit
22

33
on:
44
push:
55
pull_request:
66
types: opened
77

88
jobs:
9-
check-source-files:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-python@v5
14-
with:
15-
python-version: '3.x'
16-
- run: python3 -m pip install pre-commit
17-
- run: pre-commit run --all-files
9+
pre-commit:
10+
uses: cpp-linter/.github/.github/workflows/pre-commit.yml@main

0 commit comments

Comments
 (0)