Skip to content
Snippets Groups Projects
Unverified Commit 9ef096fd authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

chore: publish preview github pages (#33248)

parent cbea8d49
No related branches found
No related tags found
No related merge requests found
# .github/workflows/ci-preview.yml
name: Deploy PR previews
concurrency: preview-${{ github.ref }}
on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed
push:
branches:
- main
- master
- develop
jobs:
deploy-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rharkor/caching-for-turbo@v1.5
if: github.event.action != 'closed'
- name: Setup NodeJS
uses: ./.github/actions/setup-node
if: github.event.action != 'closed'
with:
node-version: 14.21.3
cache-modules: true
install: true
- name: Build
if: github.event.action != 'closed'
run: |
yarn turbo run build-preview
yarn turbo run .:build-preview-move
- uses: rossjrw/pr-preview-action@v1
with:
source-dir: .preview
preview-branch: gh-pages
umbrella-dir: pr-preview
action: auto
......@@ -47,6 +47,8 @@ yarn-error.log*
.history
.envrc
.preview
*.sublime-workspace
**/.vim/
......
......@@ -19,6 +19,7 @@ to: packages/<%= name %>/package.json
"test": "jest",
"build": "rm -rf dist && tsc -p tsconfig.json",
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput"
"build-preview": "mkdir -p ../../.preview && cp -r ./dist ../../.preview/<%= name.toLowerCase() %>"
},
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
......
......@@ -5,7 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build-preview": "tsc && vite build",
".:build-preview-move": "mkdir -p ../../.preview/ && cp -r ./dist ../../.preview/uikit-playground",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
......
......@@ -2,6 +2,14 @@
"$schema": "https://turborepo.org/schema.json",
"globalDependencies": ["tsconfig.base.json", "tsconfig.base.server.json", "tsconfig.base.client.json"],
"tasks": {
"build-preview": {
"dependsOn": ["^build"],
"outputs": ["storybook-static/**", ".storybook/**", "dist/**"]
},
".:build-preview-move": {
"dependsOn": ["^build-preview"],
"cache": false
},
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment