Skip to content

πŸ’š

πŸ’š #43

name: Templates
on:
push:
branches:
- main
paths:
- '.github/actions/**'
- '.github/workflows/sync-templates.yml'
- 'scripts/sync-templates.sh'
- 'templates/**'
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
node-version: [18.18.x]

Check failure on line 18 in .github/workflows/sync-templates.yml

View workflow run for this annotation

GitHub Actions / Templates

Invalid workflow file

The workflow is not valid. .github/workflows/sync-templates.yml (Line: 18, Col: 7): Unexpected value 'node-version'
fail-fast: false
matrix:
template:
- plate-template
- plate-playground-template
defaults:
run:
working-directory: templates/${{ matrix.template }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/[email protected]
name: Install pnpm
with:
version: 8.6.1
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: πŸ“₯ Install dependencies
run: pnpm install
- name: πŸ— Run build
run: pnpm build
sync:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
template:
- plate-template
- plate-playground-template
if: ${{ success() }}
steps:
- uses: actions/checkout@v4
- name: Sync Templates
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
run: ./scripts/sync-templates.sh "templates/${{ matrix.template }}"
shell: bash