Skip to content

Commit

Permalink
use publish tools for pages deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mucsi96 committed Mar 23, 2024
1 parent f122feb commit b743637
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,26 @@ jobs:
if: ${{ github.event_name == 'push' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
fetch-depth: 0
- uses: actions/setup-python@v4
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
python-version: 3.12
cache: pip
- uses: actions/setup-node@v4
with:
cache: npm
- run: npm ci
- run: pip install -r requirements.txt
- run: npm run build:storybook
- name: Fix permissions
run: chmod -c -R +rX storybook-static/
- name: Create archive
run: tar --dereference --hard-dereference --directory storybook-static/ -cvf "$RUNNER_TEMP/storybook-static.tar" .
- id: pack-test-pages
run: python scripts/pack_pages.py
- name: Upload artifact
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}/storybook-static.tar
path: ${{ steps.pack-test-pages.outputs.artifact }}
retention-days: 30
deploy-storybook:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- use publish tools for pages deployment
- add badge
- add button
- add button group
Expand Down
8 changes: 8 additions & 0 deletions scripts/pack_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python3

from pathlib import Path
from publish_tools import github_utils

root_directory = Path(__file__).parent.parent

github_utils.create_pages_artifact(directory=root_directory / 'storybook-static')

0 comments on commit b743637

Please sign in to comment.