-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deployment): add workflow file
- Loading branch information
Showing
1 changed file
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
|
||
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: . | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: [18] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Identify package manager | ||
id: pkgman | ||
run: | | ||
cache=`[ -f "./pnpm-lock.yaml" ] && echo "pnpm" || ([ -f "./package-lock.json" ] && echo "npm" || ([ -f "./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: 941a11660f3736aed07c48f6d809a8ccf1b150df7626d5ad24bc6464b66022ad | ||
|
||
- name: Add .nojekyll file | ||
run: touch .output/public/.nojekyll | ||
|
||
# Deployment job | ||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: ./.output/public |
863e34f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
vue-docs-next – ./
vue-docs-next.vercel.app
vue-docs-next-git-main-chakra-ui.vercel.app
vue-docs-next-chakra-ui.vercel.app
next.vue.chakra-ui.com