Skip to content

Commit

Permalink
Merge pull request #6997 from vuestorefront/feat/UST-1087-nuxt-package
Browse files Browse the repository at this point in the history
  • Loading branch information
jagoral authored Jan 5, 2024
2 parents 1c1ea5c + aeb01c1 commit d2ce487
Show file tree
Hide file tree
Showing 94 changed files with 20,029 additions and 1,146 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
**/node_modules/**/*
**/lib/*
**/dist/**/*
!**/.vuepress/**/*
packages/cache/nuxt/plugin.js
packages/nuxt-module/plugins/i18n-cookies.js
packages/nuxt-module/plugins/logger.js
packages/cli/dist
packages/middleware/__tests__/unit/test-data/*
packages/middleware/__tests__/unit/test-data/*
54 changes: 54 additions & 0 deletions .github/workflows/continuous-delivery-storefront.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Continuous Delivery (Storefront)
on:
workflow_dispatch:

jobs:
publish-next:
name: Publish Next.js
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
shell: bash
working-directory: packages/storefront
run: HUSKY=0 yarn --frozen-lockfile

- name: Build Next.js
run: yarn build
working-directory: packages/storefront/packages/next

- name: Set npm token
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }}

- name: Publish Next.js
run: yarn publish --non-interactive --access public
working-directory: packages/storefront/packages/next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}

publish-nuxt:
name: Publish Nuxt
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
shell: bash
working-directory: packages/storefront
run: HUSKY=0 yarn --frozen-lockfile

- name: Build Nuxt
run: yarn build
working-directory: packages/storefront/packages/nuxt

- name: Set npm token
run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }}

- name: Publish Nuxt
run: yarn publish --non-interactive --access public
working-directory: packages/storefront/packages/nuxt
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
74 changes: 74 additions & 0 deletions .github/workflows/continuous-integration-storefront.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Continuous Integration (Storefront)
on:
pull_request:
types: ["opened", "edited", "reopened", "synchronize"]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
scanning:
name: GitGuardian scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all history so multiple commits can be scanned
- name: GitGuardian scan
uses: GitGuardian/ggshield-action@v1.22.0
with:
args: -v
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}

run-ci:
name: Run CI
runs-on: ubuntu-latest
strategy:
matrix:
node_version: ["18"]
permissions:
contents: read
id-token: write

steps:
- name: Expose github environment as shell variables
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}
VARS_CONTEXT: ${{ toJson(vars) }}
run: |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
to_envs() { jq -r "to_entries[] | \"\(.key)<<$EOF\n\(.value)\n$EOF\n\""; }
echo "$SECRETS_CONTEXT" | to_envs >> $GITHUB_ENV
- name: Checkout code 🛎️
uses: actions/checkout@v3

- name: Setup node 🏗️
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}

- name: Install dependencies
shell: bash
working-directory: packages/storefront
run: HUSKY=0 yarn --frozen-lockfile

- name: Build project
run: yarn build
working-directory: packages/storefront

- name: Run tests
run: yarn test
working-directory: packages/storefront

- name: Lint project
run: yarn lint
working-directory: packages/storefront
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ lerna-debug.log*

# Rollup generate output
lib
dist

# Coverage directory used by tools like istanbul
coverage
Expand All @@ -27,4 +28,11 @@ coverage
.DS_STORE

# Nuxt generated files
.nuxt
.nuxt
.output

# Next generated files
.next

# Cypress generated files
**/cypress/screenshots
Loading

0 comments on commit d2ce487

Please sign in to comment.