-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the Linux-yikun-repos-cache-{times} as key, and Linux-yikun-repos-cache- as restore_key to make sure the cache would be refreshed at every PR. close #58
- Loading branch information
1 parent
936754e
commit 7681189
Showing
1 changed file
with
12 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,21 @@ jobs: | |
- name: Checkout source code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get time | ||
id: info | ||
uses: actions/[email protected] | ||
with: | ||
result-encoding: string | ||
script: | | ||
return new Date(Date.now()).toISOString().replace(/[^0-9]/g, ""); | ||
- name: Cache src repos | ||
uses: actions/cache@v1 | ||
id: cache | ||
with: | ||
path: /home/runner/work/hub-mirror-action/hub-mirror-action/hub-mirror-cache | ||
key: ${{ runner.os }}-yikun-repos-cache | ||
|
||
- name: Print the cache status | ||
if: steps.cache.outputs.cache-hit == 'true' | ||
run: echo "Cached successfully." | ||
path: ${{ github.workspace }}/hub-mirror-cache | ||
key: ${{ runner.os }}-yikun-repos-cache-${{ steps.info.outputs.result }} | ||
restore-keys: ${{ runner.os }}-yikun-repos-cache- | ||
|
||
- name: Mirror Github to Gitee with white list and cache | ||
uses: ./. | ||
|
@@ -32,4 +37,4 @@ jobs: | |
|
||
- name: Print cache path | ||
run: | | ||
ls -la /home/runner/work/hub-mirror-action/hub-mirror-action/hub-mirror-cache | ||
ls -la ${{ github.workspace }}/hub-mirror-cache |