-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
添加保存过程中产生的数据文件到github action cache选项,顺便重新整理了一下github aciton workflow (#…
…464) * 添加保存过程中产生的数据文件到github action cache选项,顺便重新整理了一下github aciton workflow 1. run_data_sync 调用 gh_page方式改成了workflow_call,这样可以传递一些数据过去。可以把设置都放在run_data_sync env中完成。在github后台看来也在一个job中完成了。 2. 缓存默认关闭,添加了文档。 3. 三个workflow中的action版本做了升级。有好几个github action提示版本过低了。 4. python和node准备环境部分做了优化。用了setup python /setup node自带的cache参数。多余的几个step删了。 * node-version: "16" -> node-version: '16' * feat: add BUILD_GH_PAGES to control build gh pages * docs: BUILD_GH_PAGES in run_data_sync.yml
- Loading branch information
Showing
5 changed files
with
159 additions
and
52 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 |
---|---|---|
|
@@ -2,14 +2,26 @@ name: Publish GitHub Pages | |
|
||
# Controls when the action will run. | ||
on: | ||
# trigger when the Run Data Sync workflow succeeded | ||
workflow_run: | ||
workflows: ["Run Data Sync"] | ||
types: | ||
- completed | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
inputs: | ||
save_data_in_github_cache: | ||
required: true | ||
type: boolean | ||
default: false | ||
data_cache_prefix: | ||
required: true | ||
type: string | ||
default: track_data | ||
workflow_call: | ||
inputs: | ||
save_data_in_github_cache: | ||
required: true | ||
type: boolean | ||
default: false | ||
data_cache_prefix: | ||
required: true | ||
type: string | ||
default: track_data | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
@@ -21,34 +33,43 @@ jobs: | |
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
- name: Cache Data Files | ||
if: inputs.save_data_in_github_cache | ||
uses: actions/cache@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
path: | | ||
activities | ||
assets | ||
GPX_OUT | ||
TCX_OUT | ||
FIT_OUT | ||
Workouts | ||
scripts/data.db | ||
src/static/activities.json | ||
imported.json | ||
key: ${{ inputs.data_cache_prefix }}-${{ github.sha }}-${{ github.run_id }} | ||
restore-keys: | | ||
${{ inputs.data_cache_prefix }}-${{ github.sha }}- | ||
${{ inputs.data_cache_prefix }}- | ||
- uses: actions/cache@v2 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
node-version: '16' | ||
cache: 'yarn' | ||
|
||
- run: | | ||
yarn install | ||
- run: | | ||
PATH_PREFIX=/${{ github.event.repository.name }} yarn build --prefix-paths | ||
- run: | | ||
cp -r assets/ public/static | ||
- name: GitHub Pages | ||
uses: crazy-max/ghaction-github-pages@v2.2.0 | ||
uses: crazy-max/ghaction-github-pages@v3 | ||
with: | ||
# Git branch where site will be deployed | ||
target_branch: gh-pages | ||
|
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
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
f8250ea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
running-page – ./
running-page-yihong0618.vercel.app
running-page.vercel.app
running-page-git-master-yihong0618.vercel.app