Skip to content

Commit

Permalink
Add step and job to sync static files
Browse files Browse the repository at this point in the history
  • Loading branch information
m417z committed Jul 5, 2023
1 parent c56aa46 commit 09af1f9
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
35 changes: 35 additions & 0 deletions .github/workflows/sync-static-files.yml
Original file line number Diff line number Diff line change
@@ -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
62 changes: 62 additions & 0 deletions RSYNC-STATIC-FILES.RCJ
Original file line number Diff line number Diff line change
@@ -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 :
::

0 comments on commit 09af1f9

Please sign in to comment.