Skip to content

Commit

Permalink
🔧 Fixes workflow with the new script
Browse files Browse the repository at this point in the history
  • Loading branch information
aruke committed Nov 5, 2023
1 parent 88bab1e commit 326f185
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions .github/workflows/build-upload-pdfs.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Generates and Uploads PDFs to Firebase Storage bucket.
# Generates and Uploads PDFs to Supabase Storage bucket.

name: Upload PDFs
on:
push:
paths:
- 'generator/**'
- '.github/workflows/**'
workflow_dispatch:


jobs:
generate-pdfs:
runs-on: ubuntu-latest
runs-on: macos-latest
strategy:
matrix:
source: [frequency, grade, jlpt, kanjigarden, wanikani]
Expand All @@ -20,34 +22,15 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Get npm cache directory path
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache/Restore
uses: actions/cache@v3
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: 'package-lock.json'

- name: Install NPM dependencies
run: npm install

- name: Build Remix app
run: npm run build

- name: Setup storage environment
run: echo $STORAGE_ENV | base64 --d > .env.storage
env:
STORAGE_ENV: ${{ secrets.STORAGE_ENV }}

- name: Generate PDF files
run: npx --yes env-cmd -f .env.storage npx remix-serve build
run: npm run build-worksheets -- --collection=${{ matrix.source }}
env:
BUILD_WORKSHEETS: true
COLLECTION: ${{ matrix.source }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}

0 comments on commit 326f185

Please sign in to comment.