Skip to content

Barris offee (#596) #529

Barris offee (#596)

Barris offee (#596) #529

Workflow file for this run

# this task just creates a data cache on the main branch which can then be reused by the github actions for pull request branches
# should save us a lot of actions time on downloading dependencies and card definitions
name: update-cache
on:
push:
branches:
- "main"
jobs:
build-cache:
name: Build Cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
- run: npm install
- name: check that card data json version file exists
uses: andstor/file-existence-action@v3
with:
files: "${{ github.workspace }}/card-data-version.txt"
fail: true
- name: get card data json cache version
id: card-data-version
run: echo "version=$(cat ${GITHUB_WORKSPACE}/card-data-version.txt)" >> $GITHUB_OUTPUT
- name: cache card data json files
id: cache-card-data
uses: actions/cache@v3
with:
path: ./test/json
key: ${{ steps.card-data-version.outputs.version }}
- if: ${{ steps.cache-card-data.outputs.cache-hit != 'true' }}
run: npm run get-cards