Skip to content

Commit

Permalink
chore: publish preview github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Sep 10, 2024
1 parent 6e4b4d7 commit 915292a
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/ci-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .github/workflows/ci-preview.yml
name: Deploy PR previews
concurrency: preview-${{ github.ref }}
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: rharkor/[email protected]
if: github.event.action != 'closed'

- name: Setup NodeJS
uses: ./.github/actions/setup-node
if: github.event.action != 'closed'
with:
cache-modules: true
install: true

- uses: rossjrw/pr-preview-action@v1
with:
source-dir: .preview
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ yarn-error.log*
.history
.envrc

.preview

*.sublime-workspace

**/.vim/
Expand Down
4 changes: 3 additions & 1 deletion apps/uikit-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build-preview": "yarn .:build-preview && yarn .:build-preview-move",
".:build-preview": "tsc && vite build",
".:build-preview-move": "mkdir -p ../../.preview/ && mv ./dist ../../.preview/uikit-playground",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
Expand Down
3 changes: 3 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"$schema": "https://turborepo.org/schema.json",
"globalDependencies": ["tsconfig.base.json", "tsconfig.base.server.json", "tsconfig.base.client.json"],
"tasks": {
"build-preview": {
"outputs": ["storybook-static/**", ".storybook/**", "dist/**"]
},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
Expand Down

0 comments on commit 915292a

Please sign in to comment.