Skip to content

Commit

Permalink
set a generalized cache path, allowing multiple data caches to be com…
Browse files Browse the repository at this point in the history
…bined
  • Loading branch information
zacharyburnett committed Jul 16, 2024
1 parent 0aec204 commit c6ecc04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/download_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: wget ${{ (github.event_name == 'schedule' || github.event_name == 'release') && env.MINIMAL_DATA_URL || inputs.minimal && env.MINIMAL_DATA_URL || env.DATA_URL }} -O ${{ runner.temp }}/webbpsf-data.tar.gz
- run: tar -xzvf ${{ runner.temp }}/webbpsf-data.tar.gz -C ${{ runner.temp }}
- run: tar -xzvf ${{ runner.temp }}/webbpsf-data.tar.gz -C ${{ runner.temp }}/data/
- id: cache_path
run: echo cache_path=${{ runner.temp }}/webbpsf-data >> $GITHUB_OUTPUT
run: echo cache_path=${{ runner.temp }}/data/ >> $GITHUB_OUTPUT
- id: version
run: echo "version=$(cat ${{ steps.cache_path.outputs.cache_path }}/version.txt)" >> $GITHUB_OUTPUT
- id: cache_key
run: echo "cache_key=webbpsf-data-${{ (github.event_name == 'schedule' || github.event_name == 'release') && 'mini' || inputs.minimal && 'mini' || 'full' }}-${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT
- uses: actions/cache/save@v4
with:
path: ${{ runner.temp }}/webbpsf-data
path: ${{ runner.temp }}/data/
key: ${{ steps.cache_key.outputs.cache_key }}
outputs:
version: ${{ steps.version.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/retrieve_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ jobs:
run: echo "version=$(${{ steps.latest_cache_key.outputs.cache_key }} | awk -F '-' '{print $4}')" >> $GITHUB_OUTPUT
outputs:
version: ${{ steps.version.outputs.version }}
cache_path: ${{ runner.temp }}/webbpsf-data
cache_path: ${{ runner.temp }}/data/
cache_key: ${{ steps.latest_cache_key.outputs.cache_key }}

0 comments on commit c6ecc04

Please sign in to comment.