Skip to content

Commit

Permalink
Merge pull request #2279 from ty-dc/pr/fix-auto-docs
Browse files Browse the repository at this point in the history
CI: Fix automatic publishing document version failure
  • Loading branch information
cyclinder committed Aug 30, 2023
2 parents b1fe538 + 207bbb3 commit 05d539d
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/auto-version-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ jobs:
needs: [release-doc, release-chart]
uses: ./.github/workflows/call-update-githubpages.yaml
with:
site_artifact_name: ${{ needs.release-doc.outputs.artifact }}
chart_artifact_name: ${{ needs.release-chart.outputs.artifact }}
secrets: inherit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call-release-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,5 @@ jobs:
delete-branch: true
base: ${{ env.DEST_BRANCH }}
signoff: true
token: ${{ secrets.WELAN_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.PR_LABEL }}
2 changes: 1 addition & 1 deletion .github/workflows/call-release-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@ jobs:
delete-branch: true
base: ${{ env.MERGE_BRANCH }}
signoff: true
token: ${{ secrets.WELAN_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.PR_LABEL }}
reviewers: ${{ env.PR_REVIWER }}
23 changes: 22 additions & 1 deletion .github/workflows/call-release-doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
submit:
required: true
type: string
outputs:
artifact:
description: "name of artifact"
value: website_package_artifact
# --- call by manual
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -106,8 +110,25 @@ jobs:
rm -rf ./site
rm -rf ./mkdocs.yml
git checkout -f ${{ env.MERGE_BRANCH }}
if ${{ env.SUBMIT != 'true' }}; then
cd docs
rm -rf ./charts
rm -rf ./index.yaml
tar -czvf ./site.tar.gz *
ls
echo "Automatic release, offline package ready"
fi
echo "Push a doc version: ${{ env.DOCS_TAG }} from branch: ${{ env.REF }}, update it to latest: ${{ env.SET_LATEST }} "
- name: Upload Artifact
uses: actions/upload-artifact@v3.1.2
if: ${{ env.SUBMIT != 'true' && env.SKIP_ALL_JOB != 'true' }}
with:
name: website_package_artifact
path: docs/site.tar.gz
retention-days: 0
if-no-files-found: error

# Allow auto-merge on general
- name: Create Pull Request
id: create_pr
Expand All @@ -121,6 +142,6 @@ jobs:
delete-branch: true
base: ${{ env.MERGE_BRANCH }}
signoff: true
token: ${{ secrets.WELAN_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.PR_LABEL }}
reviewers: ${{ env.PR_REVIWER }}
20 changes: 18 additions & 2 deletions .github/workflows/call-update-githubpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ jobs:
run: |
rm -rf _oldCharts
cp -rf ${{ env.DEST_DIRECTORY }}/charts _oldCharts
rm -rf ${{ env.DEST_DIRECTORY }}/charts
rm -rf ${{ env.DEST_DIRECTORY }}
mkdir ${{ env.DEST_DIRECTORY }}
mkdir ${{ env.DEST_DIRECTORY }}/charts
- name: Download Website Artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.site_artifact_name }}
path: ${{ env.DEST_DIRECTORY }}

- name: Download Chart Artifact
uses: actions/download-artifact@v3
with:
Expand All @@ -51,7 +58,16 @@ jobs:

- name: Untar Artifact
run: |
# untar website html
cd ${{ env.DEST_DIRECTORY }}
ALL_TAR_FILE=`ls *.tar.gz`
for ITEM in $ALL_TAR_FILE ; do
echo "untar $ITEM "
tar -xzvf $ITEM
rm -f $ITEM
done
# restore old charts
cd ..
# do not overwrite new chart tar
cp -n _oldCharts/* ${{ env.DEST_DIRECTORY }}/charts
rm -rf _oldCharts
Expand All @@ -73,5 +89,5 @@ jobs:
delete-branch: true
base: ${{ env.MERGE_BRANCH }}
signoff: true
token: ${{ secrets.WELAN_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ env.PR_LABEL }}
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repo_name: spidernet-io/spiderpool
repo_url: https://github.com/spidernet-io/spiderpool
remote_branch: github_pages
theme:
name: readthedocs
name: material
custom_dir: docs/overrides
# The maximum depth of the navigation tree in the sidebar
navigation_depth: 2
Expand Down

0 comments on commit 05d539d

Please sign in to comment.