Skip to content

Commit

Permalink
added workflow to sync, docs from repository as source of truth
Browse files Browse the repository at this point in the history
  • Loading branch information
sacha-roussakis-notter committed Feb 4, 2024
1 parent 677f4ba commit 0d35761
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/sync-vaultify-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# Clone Azure DevOps Repo
echo "Cloning the Azure DevOps repository..."
PAT=${{ secrets.AZURE_DEVOPS_PAT }}
REPO_URL="dev.azure.com/buungroupmain/devops-blueprints/_git/vaultify-docs"
REPO_URL=${{ secrets.VAULTIFY_DOCS_REPO_URL }}
# Construct the URL with the PAT
CLONE_URL="https://$PAT@$REPO_URL"
Expand Down Expand Up @@ -54,14 +54,16 @@ jobs:
rm -rf docs/cli/* || { echo "Failed to clear docs/cli directory"; exit 1; }
cp -R ../docs/cli/* docs/cli/ || { echo "Failed to copy cli directory"; exit 1; }
if git diff --quiet && git diff --cached --quiet; then
echo "No changes to sync"
else
# If changes are detected, stage, commit, and push them
git add .
git add -A
if ! git diff --staged --quiet; then
echo "Changes detected. Committing and pushing..."
git commit -m "Synced from GitHub"
if ! git push; then
echo "Failed to push changes to Azure DevOps. Exiting."
exit 1
fi
else
echo "No changes to sync"
fi

0 comments on commit 0d35761

Please sign in to comment.