Skip to content

Commit efb75da

Browse files
committed
chore(deployment): add workflow file
1 parent 9e87e2c commit efb75da

File tree

3 files changed

+73
-22
lines changed

3 files changed

+73
-22
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/studio.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: studio-nuxt-build
2+
run-name: studio nuxt build
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- 'main'
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Add write workflow permissions
14+
permissions:
15+
contents: write
16+
17+
# Allow one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
# Build job
24+
build-and-deploy:
25+
runs-on: ${{ matrix.os }}
26+
defaults:
27+
run:
28+
working-directory: docs
29+
30+
strategy:
31+
matrix:
32+
os: [ubuntu-latest]
33+
node: [20]
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
39+
- name: Identify package manager
40+
id: pkgman
41+
run: |
42+
cache=`[ -f "docs/pnpm-lock.yaml" ] && echo "pnpm" || ([ -f "docs/package-lock.json" ] && echo "npm" || ([ -f "docs/yarn.lock" ] && echo "yarn" || echo ""))`
43+
package_manager=`[ ! -z "$cache" ] && echo "$cache" || echo "pnpm"`
44+
echo "cache=$cache" >> $GITHUB_OUTPUT
45+
echo "package_manager=$package_manager" >> $GITHUB_OUTPUT
46+
47+
- name: Setup pnpm
48+
id: pnpm-install
49+
uses: pnpm/action-setup@v4
50+
with:
51+
version: 9
52+
53+
- uses: actions/setup-node@v4
54+
with:
55+
version: ${{ matrix.node }}
56+
cache: ${{ steps.pkgman.outputs.cache }}
57+
58+
- name: Install dependencies
59+
run: pnpm install --ignore-workspace
60+
61+
- name: Generate
62+
run: pnpm build --preset github_pages
63+
env:
64+
NUXT_CONTENT_PREVIEW_API: https://api.nuxt.studio
65+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
66+
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }}
67+
68+
# Deployment job
69+
- name: Deploy 🚀
70+
uses: JamesIves/github-pages-deploy-action@v4
71+
with:
72+
folder: docs/.output/public

docs/.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
shamefully-hoist=true
1+
shamefully-hoist=true

0 commit comments

Comments
 (0)