Skip to content

add additional yml

add additional yml #1

Workflow file for this run

# 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 }}