Skip to content

Commit

Permalink
ci: add gh action to copy docs/ directory to repo wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAnderegg committed Sep 28, 2023
1 parent 3a700cb commit fe74f54
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/docs-to-wiki.yml
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

0 comments on commit fe74f54

Please sign in to comment.