-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add step and job to sync static files
- Loading branch information
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
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
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
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 |
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
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 : | ||
:: |