diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ec4937971920..3f4c68ec8f3d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,3 +49,14 @@ jobs: run: | cd data python -u deploy.py + - name: Sync static files + # https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code + run: | + robocopy /job:RSYNC-STATIC-FILES || [ $? -lt 8 ] + - name: Commit changes of static files + uses: EndBug/add-and-commit@v9 + with: + cwd: data/gh-pages + default_author: github_actions + message: 'Sync static files' + fetch: false diff --git a/.github/workflows/sync-static-files.yml b/.github/workflows/sync-static-files.yml new file mode 100644 index 000000000000..85fef9d41509 --- /dev/null +++ b/.github/workflows/sync-static-files.yml @@ -0,0 +1,35 @@ +name: Sync Static Files + +defaults: + run: + shell: bash + +on: + workflow_dispatch: + +concurrency: sync-static-files + +jobs: + update: + runs-on: windows-latest + steps: + - name: Checkout main + uses: actions/checkout@v3 + with: + ref: main + - name: Checkout gh-pages + uses: actions/checkout@v3 + with: + ref: gh-pages + path: data/gh-pages + - name: Sync static files + # https://superuser.com/questions/280425/getting-robocopy-to-return-a-proper-exit-code + run: | + robocopy /job:RSYNC-STATIC-FILES || [ $? -lt 8 ] + - name: Commit changes of static files + uses: EndBug/add-and-commit@v9 + with: + cwd: data/gh-pages + default_author: github_actions + message: 'Sync static files' + fetch: false diff --git a/RSYNC-STATIC-FILES.RCJ b/RSYNC-STATIC-FILES.RCJ new file mode 100644 index 000000000000..b24a09847aa8 --- /dev/null +++ b/RSYNC-STATIC-FILES.RCJ @@ -0,0 +1,62 @@ + +:: +:: Robocopy Job .\RSYNC-STATIC-FILES.RCJ +:: +:: Created by User on Wednesday, July 5, 2023 at 09:04:19 +:: +:: Created with : +:: robocopy . .\data\gh-pages /MIR /XD .* /XD data /XD hashes /XF .* /XF CNAME /XF LICENSE /XF package-lock.json /XF package.json /XF README.md /XF RSYNC-STATIC-FILES.RCJ /save:rsync-static-files +:: + +:: +:: Source Directory : +:: + /SD:.\ :: Source Directory. + +:: +:: Destination Directory : +:: + /DD:.\data\gh-pages\ :: Destination Directory. + +:: +:: Include These Files : +:: + /IF :: Include Files matching these names +:: *.* :: Include all names (currently - Command Line may override) + +:: +:: Exclude These Directories : +:: + /XD :: eXclude Directories matching these names + data + hashes + .* + +:: +:: Exclude These Files : +:: + /XF :: eXclude Files matching these names + CNAME + LICENSE + package-lock.json + package.json + README.md + RSYNC-STATIC-FILES.RCJ + .* +:: +:: Copy options : +:: + /S :: copy Subdirectories, but not empty ones. + /E :: copy subdirectories, including Empty ones. + /DCOPY:DA :: what to COPY for directories (default is /DCOPY:DA). + /COPY:DAT :: what to COPY for files (default is /COPY:DAT). + /PURGE :: delete dest files/dirs that no longer exist in source. + /MIR :: MIRror a directory tree (equivalent to /E plus /PURGE). +:: +:: Retry Options : +:: + /R:1000000 :: number of Retries on failed copies: default 1 million. + /W:30 :: Wait time between retries: default is 30 seconds. +:: +:: Logging Options : +::