reworked whole readme #11
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
name: Sync to Azure DevOps | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.md' # Run workflow for any markdown file changes in the repo | |
- 'LICENSE' # Run workflow for changes to the LICENSE file in the root | |
- 'docs/cli/**' # Run workflow for any changes in the /docs/cli directory | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout GitHub Repo | |
uses: actions/checkout@v2 | |
- name: Configure Git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "vaultify_automation" | |
- name: Sync to Azure DevOps | |
env: | |
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} | |
run: | | |
# Clone Azure DevOps Repo | |
echo "Cloning the Azure DevOps repository..." | |
PAT=${{ secrets.AZURE_DEVOPS_PAT }} | |
REPO_URL=${{ secrets.VAULTIFY_DOCS_REPO_URL }} | |
# Construct the URL with the PAT | |
CLONE_URL="https://$PAT@$REPO_URL" | |
# Clone the repository using the constructed URL | |
if ! git clone "$CLONE_URL" vaultify-docs; then | |
echo "Failed to clone Azure DevOps repository. Exiting." | |
exit 1 | |
fi | |
cd vaultify-docs || exit | |
# Sync root level documentation | |
cp -f ../README.md docs/README.md || { echo "Failed to copy README.md"; exit 1; } | |
cp -f ../CHANGELOG.md docs/CHANGELOG.md || { echo "Failed to copy CHANGELOG.md"; exit 1; } | |
cp -f ../LICENSE docs/LICENSE.md || { echo "Failed to copy LICENSE.md"; exit 1; } | |
# Ensure the docs directory exists | |
mkdir -p docs/cli | |
# Sync specific documentation within docs | |
cp -f ../docs/CLI.md docs/CLI.md || { echo "Failed to copy CLI.md"; exit 1; } | |
cp -f ../CONTRIBUTING.md docs/CONTRIBUTING.md || { echo "Failed to copy CONTRIBUTING.md"; exit 1; } | |
# Sync cli directory | |
rm -rf docs/cli/* || { echo "Failed to clear docs/cli directory"; exit 1; } | |
cp -f -R ../docs/cli/* docs/cli/ || { echo "Failed to copy cli directory"; exit 1; } | |
git add . | |
git commit -m "Synced from GitHub" | |
git push origin main |