debug collect in docker image #487
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
--- | |
# yamllint disable rule:truthy rule:line-length | |
name: Sync Folders | |
on: | |
push: | |
branches: | |
- stable | |
paths: | |
- '.vale/**' | |
- 'docs/docs/**' | |
- 'docs/sidebars.ts' | |
pull_request: | |
branches: | |
- stable | |
jobs: | |
sync: | |
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source repository | |
uses: actions/checkout@v4 | |
with: | |
path: source-repo | |
- name: Checkout target repository | |
uses: actions/checkout@v4 | |
with: | |
repository: opsmill/infrahub-docs | |
token: ${{ secrets.GH_INFRAHUB_BOT_TOKEN }} | |
path: target-repo | |
- name: Sync folders | |
run: | | |
rm -rf target-repo/.vale/* | |
rm -rf target-repo/docs/docs/* | |
rm -f target-repo/docs/sidebars.ts | |
cp -r source-repo/.vale/* target-repo/.vale/ | |
cp -r source-repo/docs/docs/* target-repo/docs/docs/ | |
cp source-repo/docs/sidebars.ts target-repo/docs/sidebars.ts | |
sed -i "/docsSidebar/,/\],/ s/'readme',/'introduction\/readme',/" target-repo/docs/sidebars.ts | |
mkdir target-repo/docs/docs/introduction | |
mv target-repo/docs/docs/readme.mdx target-repo/docs/docs/introduction/ | |
sed -i '/^title: Introduction/i sidebar_label: Introduction' target-repo/docs/docs/introduction/readme.mdx | |
sed -i 's|](\./|](/|g' target-repo/docs/docs/introduction/readme.mdx | |
cd target-repo | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add . | |
if ! (git diff --quiet && git diff --staged --quiet); then git commit -m "Sync docs from infrahub repo" && git push; fi |