Skip to content

Commit

Permalink
feat: add github pages config
Browse files Browse the repository at this point in the history
  • Loading branch information
asvae committed Jun 21, 2024
1 parent eef4a96 commit 0762669
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ui-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# https://github.com/actions/deploy-pages#usage
name: Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- deploy-test
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: "20"
cache: 'yarn'
# Pick your own package manager and build script
- run: yarn install
- run: yarn build:docs:ci:googledocs
env:
HOSTNAME: "https://ui-develop.vuestic.dev" # Example env variable
STORYBOOK_HOSTNAME: "https://ui-storybook-develop.vuestic.dev"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./packages/ui/.output/public
# Deployment job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github_pages environment
environment:
name: github_pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"serve:docs": "yarn workspace docs serve",
"build:docs": "yarn workspace docs build",
"build:docs:ci": "yarn workspace docs build:ci",
"build:docs:ci:googledocs": "yarn workspace docs build:ci:googledocs",
"push": "yarn workspace vuestic-ui push",
"push-production": "yarn workspace vuestic-ui push-production",
"build:nuxt": "yarn workspace @vuestic/nuxt build",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_STORYBOOK_HOSTNAME=https://ui-storybook.vuestic.dev
STORYBOOK_HOSTNAME=https://ui-storybook.vuestic.dev
HOSTNAME=https://ui.vuestic.dev
GTM_ENABLED=true
GTM_ID=GTM-12345678
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default defineNuxtConfig({

runtimeConfig: {
public: {
VITE_STORYBOOK_HOSTNAME: process.env.STORYBOOK_HOSTNAME,
STORYBOOK_HOSTNAME: process.env.STORYBOOK_HOSTNAME,
RECAPTCHA_SITE_KEY: process.env.RECAPTCHA_SITE_KEY,
},
},
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "0.0.1",
"scripts": {
"build": "yarn build:analysis && nuxt generate --max_old_space_size=4096",
"build:ci": "yarn build:analysis && nuxt generate",
"build:ci": "yarn build:analysis && nuxt generate --preset github_pages ",
"build:ci:googledocs": "yarn build:analysis && nuxt build --preset github_pages ",
"start:ci": "yarn preview",
"build:analysis": "yarn workspace sandbox build:analysis ../docs/page-config/getting-started/tree-shaking",
"serve": "yarn build:analysis --use-cache && nuxt dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/page-config/contribution/guide/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default definePageConfig({
"We use [yarn](https://yarnpkg.com/lang/en/)[[target=_blank]] for package management.",
"Be proactive. If you think something is wrong - create an issue or discuss.",
"Recommended tools: [GitKraken](https://www.gitkraken.com/)[[target=_blank]], [WebStorm](https://www.jetbrains.com/webstorm/)[[target=_blank]], [ShareX](https://getsharex.com/)[[target=_blank]].",
`If you work on UI components - work in [storybook](${process.env.VITE_STORYBOOK_HOSTNAME})[[target=_blank]] environment (\`yarn serve:storybook\`). We want to keep global stuff out of components.`
`If you work on UI components - work in [storybook](${process.env.STORYBOOK_HOSTNAME})[[target=_blank]] environment (\`yarn serve:storybook\`). We want to keep global stuff out of components.`
]),

block.subtitle("Credits"),
Expand Down

0 comments on commit 0762669

Please sign in to comment.