-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (65 loc) · 2.21 KB
/
studio.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: studio-nuxt-build
run-name: studio nuxt build
on:
# Runs on pushes targeting the default branch
push:
branches:
- 'main'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Add write workflow permissions
permissions:
contents: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
# Build job
build-and-deploy:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: packages/docs
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Identify package manager
id: pkgman
run: |
cache=`[ -f "packages/docs/pnpm-lock.yaml" ] && echo "pnpm" || ([ -f "packages/docs/package-lock.json" ] && echo "npm" || ([ -f "packages/docs/yarn.lock" ] && echo "yarn" || echo ""))`
package_manager=`[ ! -z "$cache" ] && echo "$cache" || echo "pnpm"`
echo "cache=$cache" >> $GITHUB_OUTPUT
echo "package_manager=$package_manager" >> $GITHUB_OUTPUT
- uses: pnpm/[email protected]
if: ${{ steps.pkgman.outputs.package_manager == 'pnpm' }}
name: Install pnpm
id: pnpm-install
with:
version: 8
- uses: actions/setup-node@v3
with:
version: ${{ matrix.node }}
cache: ${{ steps.pkgman.outputs.cache }}
- name: Install dependencies
run: ${{ steps.pkgman.outputs.package_manager }} install
- name: Install @nuxthq/studio
run: ${{ steps.pkgman.outputs.package_manager }} add -D @nuxthq/studio
- name: Create .nuxtrc
run: echo $'\nautoImport=true\nmodules[]=@nuxthq/studio' >> .nuxtrc
- name: Generate
run: npx nuxi generate
env:
NUXT_PUBLIC_STUDIO_API_URL: https://api.nuxt.studio
NUXT_PUBLIC_STUDIO_TOKENS: eec209c726d7129192351fad2dc9db434d5a1dd6b1e168f3ae5fef11d0dc7ab7
- name: Add .nojekyll file
run: touch .output/public/.nojekyll
# Deployment job
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: packages/docs/.output/public