From 4874901fe51baf573835220ca59c1736fa6f9b02 Mon Sep 17 00:00:00 2001 From: Kevin Schaul Date: Mon, 20 May 2024 12:57:35 -0500 Subject: [PATCH] update --- .github/workflows/deploy.yml | 40 ++++++++++++++++++++++++++++++++++++ package.json | 4 +++- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f61477f..84cae35 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -65,6 +65,46 @@ jobs: git commit -m "chore: update readme at ${timestamp}" || exit 0 git push + - name: Set up Python + if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - uses: actions/cache@v4 + if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} + name: Configure pip caching + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Cache Playwright browsers + if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} + uses: actions/cache@v4 + with: + path: ~/.cache/ms-playwright/ + key: ${{ runner.os }}-browsers + + - name: Install Python dependencies + if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} + run: | + pip install -r jump-start-gallery/requirements.txt + + - name: Install Playwright dependencies + if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} + run: | + shot-scraper install + + - name: Start server and take screenshots + if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} + run: | + mkdir -p jump-start-gallery/public/screenshots && + npm run dev & + sleep 2 && + npm run update-screenshots + - name: Build custom site if: ${{ env.DEPLOY_CUSTOM_SITE == 'true' }} env: diff --git a/package.json b/package.json index 69d8e37..714eab2 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "storybook": "cd jump-start-gallery && JUMP_START_STARTERS=../ npm run storybook", "build-storybook": "cd jump-start-gallery && JUMP_START_STARTERS=../ npm run build-storybook", "update-readme": "cd jump-start-gallery && JUMP_START_STARTERS=../ npm run update-readme", + "update-screenshots": "cd jump-start-gallery && JUMP_START_STARTERS=../ npm run update-screenshots", "gallery:clone": "git submodule update --init", "gallery:update": "git submodule sync --recursive", "gallery:install": "cd jump-start-gallery && npm install", @@ -26,5 +27,6 @@ "bugs": { "url": "https://github.com/kevinschaul/jump-start-template/issues" }, - "homepage": "https://github.com/kevinschaul/jump-start-template#readme" + "homepage": "https://github.com/kevinschaul/jump-start-template#readme", + "dependencies": {} }