Skip to content

Commit

Permalink
add additional yml
Browse files Browse the repository at this point in the history
Signed-off-by: Hannah Bollar <[email protected]>
  • Loading branch information
hanbollar committed Jan 19, 2024
1 parent 5fda6df commit 54b279a
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/readme-to-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Auto generate docs as a new commit for the docs repo
name: update readme to docs

on:
workflow_dispatch:
push:
# branches:
# - main

permissions:
contents: read

jobs:
readme-update-to-docs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Get README content
id: get-readme
run: |
cp README.md ../new-src-index.md
- name: see if info is there
run: |
echo "ll .."
ls -al ..
echo "ll ."
ls -al .
- name: Checkout documentation Repository
uses: actions/checkout@v4
with:
repository: Volumetrics-io/documentation
ref: main
token: ${{ secrets.MRJS_AND_DOCS_REPO_PAT }}

- name: Update Docs
run: |
rm "./source/index.md"
mv -f "../new-src-index.md" "./source/index.md"
- name: Commit only if there are changes
run: |
if [[ -n $(git diff --exit-code) ]]; then
echo "Changes detected. Committing and pushing."
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
commit_message=$'👷 MR.js - Auto Generated README to Index Update 👷\n\nChanges at '"${GITHUB_SHA}"
git add .
git commit -m "$commit_message"
git push --quiet --set-upstream origin HEAD
else
echo "No changes detected. Exiting without committing."
fi
env:
GITHUB_TOKEN: ${{ secrets.MRJS_AND_DOCS_REPO_PAT }}

0 comments on commit 54b279a

Please sign in to comment.