Skip to content

Commit

Permalink
Merge pull request #80 from diverta/nuxt3
Browse files Browse the repository at this point in the history
Nuxt3
  • Loading branch information
takel-shiba authored May 10, 2024
2 parents b25c9e7 + 137ed96 commit 5b06c7b
Show file tree
Hide file tree
Showing 121 changed files with 14,094 additions and 42,496 deletions.
Binary file added .DS_Store
Binary file not shown.
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

13 changes: 0 additions & 13 deletions .editorconfig

This file was deleted.

1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BASE_URL=https://dev-nuxt-auth.a.kuroco.app
37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

95 changes: 82 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,105 @@
name: Build and Deploy
name: Build and deploy to Kuroco front
on:
push:
branches:
- main
issue_comment:
types: [created, edited]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
# for Pull Request (exclude merged)
pullreq_build:
name: Build(pullreq)
if: (github.repository == 'diverta/front_nuxt_auth' && github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/kuroco stage') && github.event.issue.pull_request != null)
runs-on: ubuntu-latest
steps:
- name: "Get branch name and sha"
id: get_branch
run: |
PR=$(curl -H "X-Kuroco-Auth: token 79a0dac07eb8af664820afa615e28575" https://dev-nuxt-auth.a.kuroco.app/direct/menu/github/?pr=${{ github.event.issue.pull_request.url }})
echo "branch=$(echo $PR | jq -r '.ref')" >> $GITHUB_OUTPUT
echo "sha=$(echo $PR | jq -r '.sha')" >> $GITHUB_OUTPUT
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ steps.get_branch.outputs.branch }}
- name: Use Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '18.x'
- name: CI Cache
uses: actions/cache@v4
id: node_modules_cache_id
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref_name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }}
run: npm ci
- name: Build
run: npm run build

- name: Generate
run: npm run generate
- name: Zip artifact for upload
run: cd ./.output/public && zip ../../dist.zip . -r
- name: Archive Production Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_branch.outputs.sha }}-${{ github.run_id }}
path: dist.zip
retention-days: 1
- name: Wait for Artifact download
run: sleep 15
- name: Webhook
uses: diverta/workflow-webhook@v3
env:
webhook_url: "https://dev-nuxt-auth.a.kuroco.app/direct/menu/github/"
webhook_secret: "79a0dac07eb8af664820afa615e28575"
data: '{"single_zip":"1","domain":"dev-nuxt-auth.g.kuroco-front.app","pr":"${{ github.event.issue.pull_request.url }}", "repository":"${{ github.repository }}", "run_id":"${{ github.run_id }}", "hash":"${{ steps.get_branch.outputs.sha }}"}'

#for Push
pushed_build:
name: Build(pushed)
if: (github.repository == 'diverta/front_nuxt_auth' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch'))
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: CI Cache
uses: actions/cache@v4
id: node_modules_cache_id
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.ref_name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
if: ${{ steps.node_modules_cache_id.outputs.cache-hit != 'true' }}
run: npm ci

- name: Generate
run: npm run generate
- name: Zip artifact for upload
run: cd ./.output/public && zip ../../dist.zip . -r
- name: Archive Production Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}-${{ github.run_id }}
path: dist
path: dist.zip
retention-days: 7
- name: Webhook
uses: distributhor/workflow-webhook@v1
uses: diverta/workflow-webhook@v3
env:
webhook_url: "https://dev-nuxt-auth.a.kuroco.app/direct/menu/github/"
webhook_secret: "79a0dac07eb8af664820afa615e28575"
data: '{"domain":"dev-nuxt-auth.g.kuroco-front.app", "repository":"${{ github.repository }}", "run_id":"${{ github.run_id }}", "hash":"${{ github.sha }}"}'

data: '{"single_zip":"1","domain":"dev-nuxt-auth.g.kuroco-front.app", "repository":"${{ github.repository }}", "run_id":"${{ github.run_id }}", "hash":"${{ github.sha }}"}'
100 changes: 17 additions & 83 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,90 +1,24 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
/logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
# Nuxt dev/build outputs
.output
.data
.nuxt

# Nuxt generate
.nitro
.cache
dist

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless

# IDE / Editor
.idea
# Node dependencies
node_modules

# Service worker
sw.*
# Logs
logs
*.log

# macOS
# Misc
.DS_Store
.fleet
.idea

# Vim swap files
*.swp
# Local env files
.env
.env.*
!.env.example
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.7.1
7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 200,
"tabWidth": 4
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"vue.volar",
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"esbenp.prettier-vscode"
]
}
27 changes: 27 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"editor.formatOnSave": true,
"css.validate": true,
"scss.validate": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[css,scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "always"
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "always"
}
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": "always"
}
},
"prettier.configPath": "./.prettierrc.json",
"prettier.useEditorConfig": false,
"eslint.experimental.useFlatConfig": true
}
7 changes: 0 additions & 7 deletions LICENSE

This file was deleted.

Loading

0 comments on commit 5b06c7b

Please sign in to comment.