generated from EVerest/everest-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andreas Heinrich <[email protected]>
- Loading branch information
Showing
1 changed file
with
59 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,59 @@ | ||
name: 'Deploy Doxygen Docs' | ||
description: 'Deploy Doxygen Docs to a github pages repository' | ||
inputs: | ||
target_repo: | ||
description: 'Repository to deploy docs to' | ||
required: true | ||
github_token: | ||
description: 'Github token, with write access to the target repository' | ||
required: true | ||
source_repo: | ||
description: 'Repository to deploy docs from' | ||
required: true | ||
default: ${{ github.repository }} | ||
workflow_run_id: | ||
description: 'Workflow run id to deploy docs from' | ||
required: true | ||
default: ${{ github.run_id }} | ||
docs_directory: | ||
description: 'Directory or containing the docs to deploy' | ||
required: true | ||
outputs: | ||
deployed_path: | ||
description: 'Path to the deployed docs' | ||
value: ${{ steps.determine_target_path.outputs.target_path }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Configure git | ||
shell: bash | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Github Service Account" | ||
- name: Checkout target repository | ||
uses: actions/[email protected] | ||
with: | ||
repository: ${{ inputs.target_repo }} | ||
path: gh-pages-repo | ||
token: ${{ inputs.github_token }} | ||
ref: main | ||
- name: Determine target path | ||
id: determine_target_path | ||
shell: bash | ||
run: | | ||
target_path="doxygen-docs/${{ inputs.source_repo }}" | ||
echo "target_path=$target_path" >> $GITHUB_OUTPUT | ||
- name: Copy Docs | ||
shell: bash | ||
run: | | ||
mkdir -p gh-pages-repo/docs/${{ steps.determine_target_path.outputs.target_path }} | ||
rm -rf gh-pages-repo/docs/${{ steps.determine_target_path.outputs.target_path }}/* | ||
cp -r ${{ inputs.docs_directory }}/* gh-pages-repo/docs/${{ steps.determine_target_path.outputs.target_path }} | ||
- name: Commit and push logs | ||
shell: bash | ||
run: | | ||
git add docs/${{ steps.determine_target_path.outputs.target_path }} | ||
commit_message="Deploy doxygen docs and remove old docs: ${{ inputs.source_repo }}/${{ inputs.artifact_name }}" | ||
git diff-index --quiet HEAD || git commit -m "$commit_message" | ||
git push | ||
working-directory: gh-pages-repo |