From 594ba0064e76c5b6d455e28722c8b656adf0baed Mon Sep 17 00:00:00 2001 From: encse Date: Thu, 12 Dec 2024 19:46:25 +0100 Subject: [PATCH] update workflow --- .github/workflows/update-docs.yaml | 31 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml index fac93c9d..62acdb9a 100644 --- a/.github/workflows/update-docs.yaml +++ b/.github/workflows/update-docs.yaml @@ -17,6 +17,12 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 + + - name: Configure Git + run: | + # Configure Git + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: Set up Node.js uses: actions/setup-node@v3 @@ -31,22 +37,17 @@ jobs: ls -la node docs/build.js - - name: Deploy to Docs Branch - run: | - # Configure Git - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - # Preserve built files - mv build .. - - # Switch to the docs branch - git checkout docs - git rm -rf . || true - cp -r ../build/* . - rm -rf ../build + + - name: Checkout docs repository + uses: actions/checkout@v3 + with: + path: distr + ref: docs - # Commit and push changes + - name: Deploy docs + run: | + rsync -av --exclude='.git/' --del build/ distr/ + cd distr git add . git commit -m "Update docs on $(date)" git push --force origin docs