-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable submodule checkout and adding new workflows for mkdocs related…
… repos (#87) * enabling submodule checkout, needed for mto-docs * adding new workflows for mkdocs related repos. updating existing ones with submodule checkout enabled --------- Co-authored-by: Fateh Ullah <[email protected]>
- Loading branch information
Showing
7 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Deleting a branch for versioned mkdocs | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GH_TOKEN: | ||
description: "GitHub token" | ||
required: true | ||
|
||
jobs: | ||
delete: | ||
if: github.event.ref_type == 'branch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if the deleted branch is a version branch | ||
id: branch_check | ||
uses: MeilCli/regex-match@v1 | ||
with: | ||
regex_pattern: '^[0-9]+\.[0-9]+(\.[0-9]+)?$' | ||
search_string: ${{ github.event.ref }} | ||
|
||
- name: Checkout source files | ||
if: steps.branch_check.outputs.matched == 'true' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
persist-credentials: true | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Set up Python | ||
if: steps.branch_check.outputs.matched == 'true' | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install mike | ||
run: pip3 install mike | ||
|
||
- name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders | ||
run: | | ||
chmod +x prepare_theme.sh | ||
./prepare_theme.sh | ||
- name: Configure Git user | ||
if: steps.branch_check.outputs.matched == 'true' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "stakater-user" | ||
- name: Delete removed version | ||
if: steps.branch_check.outputs.matched == 'true' | ||
run: mike delete --push ${{ github.event.ref }} | ||
|
||
- name: Push Latest Tag | ||
if: steps.branch_check.outputs.matched == 'true' | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
WITH_V: true | ||
DEFAULT_BUMP: patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Closing a pull request for versioned mkdocs | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GH_TOKEN: | ||
description: "GitHub token" | ||
required: true | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source files | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
persist-credentials: true | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install mike | ||
run: pip3 install mike | ||
|
||
- name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders | ||
run: | | ||
chmod +x prepare_theme.sh | ||
./prepare_theme.sh | ||
- name: Configure Git user | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "stakater-user" | ||
- name: Delete redundant PR deployment | ||
env: | ||
HEAD_REF: ${{ github.head_ref }} | ||
run: mike delete --push -b pull-request-deployments ${HEAD_REF//\//-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Pull request for versioned mkdocs | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GH_TOKEN: | ||
description: "GitHub token" | ||
required: true | ||
|
||
jobs: | ||
deploy_doc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source files | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
persist-credentials: true | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install mike | ||
run: pip3 install mike | ||
|
||
- name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders | ||
run: | | ||
chmod +x prepare_theme.sh | ||
./prepare_theme.sh | ||
- name: Configure git user | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "stakater-user" | ||
- name: Deploy PR docs | ||
env: | ||
HEAD_REF: ${{ github.head_ref }} | ||
run: mike deploy --push -b pull-request-deployments ${HEAD_REF//\//-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Push versioned mkdocs | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
GH_TOKEN: | ||
description: "GitHub token" | ||
required: true | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source files | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
persist-credentials: true | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install mike | ||
run: pip3 install mike | ||
|
||
- name: Run prepare_theme.sh script from repository to merge theme_common and theme_override folders | ||
run: | | ||
chmod +x prepare_theme.sh | ||
./prepare_theme.sh | ||
- name: Configure Git user | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "stakater-user" | ||
- name: Deploy content | ||
run: mike deploy --push ${{ github.ref_name }} | ||
|
||
- name: Set alias | ||
run: mike alias --push main latest | ||
|
||
- name: Set default doc version | ||
run: mike set-default --push latest | ||
|
||
- name: Push Latest Tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
WITH_V: true | ||
DEFAULT_BUMP: patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters