-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add gh action to copy docs/ directory to repo wiki
- Loading branch information
1 parent
3a700cb
commit fe74f54
Showing
1 changed file
with
55 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,55 @@ | ||
name: Copy `docs/` to repo wiki | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- DEVREL-34-document-basic-usage | ||
workflow_dispatch: | ||
|
||
jobs: | ||
copy-docs: | ||
name: Copy contents of `docs/` to wiki repo | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Checkout the present repo under the `repo/` dir | ||
- name: Checkout base repo | ||
uses: actions/checkout@v2 | ||
with: | ||
path: repo | ||
|
||
- name: Checkout wiki repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: "${{ github.repository }}.wiki" | ||
path: wiki | ||
|
||
# Checkout the wiki repo under the `wiki/` dir | ||
# - name: Checkout wiki repo | ||
# run: | | ||
# git config --global user.name "GitHub Actions" | ||
# git config --global user.email "[email protected]" | ||
|
||
# git clone https://github.com/workflows-sh/aws-eks-ec2-asg-cdk.wiki.git wiki | ||
|
||
# Copy the contents of `docs/` to `wiki/` | ||
# This will overwrite any existing files in the wiki repo, because | ||
# the contents of the `wiki/` dir are deleted before the copy, ensuring | ||
# that the wiki repo is always in sync with the base repo. | ||
- name: Copy docs/ to wiki/ | ||
run: | | ||
rm -rf wiki/* | ||
cp -r repo/docs/* wiki/ | ||
mv wiki/README.md wiki/Home.md | ||
- name: Commit and push changes to wiki | ||
run: | | ||
cd wiki | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "[email protected]" | ||
git add . | ||
git commit -m "Update wiki with latest docs" | ||
git push |