generated from acdh-oeaw/template-app-nuxt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8e234a3
Showing
86 changed files
with
14,277 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,52 @@ | ||
## .gitignore ## | ||
|
||
# dependencies | ||
node_modules/ | ||
.pnpm-store/ | ||
|
||
# logs | ||
*.log | ||
|
||
# non-public environment variables | ||
.env.local | ||
.env.*.local | ||
|
||
# caches | ||
.eslintcache | ||
.stylelintcache | ||
*.tsbuildinfo | ||
|
||
# vercel | ||
.vercel | ||
|
||
# misc | ||
.DS_Store | ||
.idea/ | ||
|
||
# nuxt.js | ||
dist | ||
.nuxt/ | ||
.nitro/ | ||
.output/ | ||
|
||
# playwright | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
||
|
||
## .dockerignore ## | ||
|
||
# git | ||
.git/ | ||
.gitignore | ||
|
||
# github | ||
.github/ | ||
|
||
# vscode settings | ||
.vscode/ | ||
|
||
# environment variables | ||
.env | ||
.env.* |
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,13 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = tab | ||
insert_final_newline = true | ||
max_line_length = 100 | ||
trim_trailing_whitespace = true | ||
|
||
[*.{yaml,yml}] | ||
indent_style = space |
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,14 @@ | ||
# ------------------------------------------------------------------------------------------------- | ||
# app | ||
# ------------------------------------------------------------------------------------------------- | ||
NUXT_PUBLIC_APP_BASE_URL="http://localhost:3000" | ||
# imprint service | ||
NUXT_PUBLIC_REDMINE_ID= | ||
# web crawlers | ||
BOTS="disabled" | ||
|
||
# ------------------------------------------------------------------------------------------------- | ||
# analytics | ||
# ------------------------------------------------------------------------------------------------- | ||
NUXT_PUBLIC_MATOMO_BASE_URL="https://matomo.acdh.oeaw.ac.at" | ||
# NUXT_PUBLIC_MATOMO_ID= |
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 @@ | ||
* text=auto eol=lf |
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,91 @@ | ||
name: Build and deploy | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
env: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Derive environment from git ref | ||
id: environment | ||
run: | | ||
if [ "${{ github.ref }}" = "refs/heads/main" ]; then | ||
echo "environment=production" >> "$GITHUB_OUTPUT" | ||
elif [ "${{ github.ref }}" = "refs/heads/development" ]; then | ||
echo "environment=development" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "environment=review/${{ github.ref_name }}" >> "$GITHUB_OUTPUT" | ||
fi | ||
outputs: | ||
environment: ${{ steps.environment.outputs.environment }} | ||
registry: ghcr.io | ||
image: ${{ github.repository }}/${{ github.ref_name }} | ||
|
||
build: | ||
needs: [env] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ needs.env.outputs.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ needs.env.outputs.registry }}/${{ needs.env.outputs.image }} | ||
tags: | | ||
type=raw,value={{sha}} | ||
type=ref,event=branch | ||
# type=ref,event=pr | ||
# type=semver,pattern={{version}} | ||
# type=semver,pattern={{major}}.{{minor}} | ||
# type=raw,value=latest | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
NUXT_PUBLIC_APP_BASE_URL="${{ vars.NUXT_PUBLIC_APP_BASE_URL }}" | ||
NUXT_PUBLIC_REDMINE_ID="${{ vars.NUXT_PUBLIC_REDMINE_ID }}" | ||
NUXT_PUBLIC_MATOMO_BASE_URL="${{ vars.NUXT_PUBLIC_MATOMO_BASE_URL }}" | ||
NUXT_PUBLIC_MATOMO_ID="${{ vars.NUXT_PUBLIC_MATOMO_ID }}" | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
deploy: | ||
needs: [env, build] | ||
uses: acdh-oeaw/gl-autodevops-minimal-port/.github/workflows/deploy-cluster-2.yml@main | ||
secrets: inherit | ||
with: | ||
DOCKER_TAG: ${{ needs.env.outputs.registry }}/${{ needs.env.outputs.image }} | ||
APP_NAME: "frontend" | ||
APP_ROOT: "/" | ||
SERVICE_ID: "${{ vars.NUXT_PUBLIC_REDMINE_ID }}" | ||
PUBLIC_URL: "${{ vars.NUXT_PUBLIC_APP_BASE_URL }}" | ||
POSTGRES_ENABLED: false | ||
environment: ${{ needs.env.outputs.environment }} | ||
default_port: "3000" |
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,79 @@ | ||
name: Validate | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
validate: | ||
name: Validate | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node-version: [18.x] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Checkout respository | ||
uses: actions/checkout@v3 | ||
|
||
# necessary because `actions/setup-node` does not yet support `corepack`. | ||
# @see https://github.com/actions/setup-node/issues/531 | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Format | ||
run: pnpm run format:check | ||
|
||
- name: Lint | ||
run: pnpm run lint:check | ||
|
||
- name: Typecheck | ||
run: pnpm run types:check | ||
|
||
- name: Test | ||
run: pnpm run test | ||
|
||
- name: Install playwright browsers | ||
run: pnpm exec playwright install --with-deps | ||
|
||
- name: Build app | ||
run: pnpm run build | ||
env: | ||
NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" | ||
NUXT_PUBLIC_REDMINE_ID: "${{ vars.NUXT_PUBLIC_REDMINE_ID }}" | ||
|
||
- name: Run e2e tests | ||
run: pnpm run test:e2e | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
|
||
build-deploy: | ||
if: ${{ github.event_name == 'push' }} | ||
needs: [validate] | ||
uses: ./.github/workflows/build-deploy.yml |
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,36 @@ | ||
# dependencies | ||
node_modules/ | ||
.pnpm-store/ | ||
|
||
# logs | ||
*.log | ||
|
||
# non-public environment variables | ||
.env.local | ||
.env.*.local | ||
|
||
# caches | ||
.eslintcache | ||
.stylelintcache | ||
*.tsbuildinfo | ||
|
||
# vercel | ||
.vercel | ||
|
||
# misc | ||
.DS_Store | ||
.idea/ | ||
|
||
# nuxt.js | ||
dist | ||
.nuxt/ | ||
.nitro/ | ||
.output/ | ||
|
||
# playwright | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
||
# references | ||
references/ |
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,6 @@ | ||
engine-strict=true | ||
# still necessary for nuxt 3 | ||
# @see https://github.com/nuxt/nuxt/issues/14146 | ||
shamefully-hoist=true | ||
shell-emulator=true | ||
use-node-version=19.2.0 |
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,13 @@ | ||
{ | ||
"recommendations": [ | ||
"bradlc.vscode-tailwindcss", | ||
"dbaeumer.vscode-eslint", | ||
"editorconfig.editorconfig", | ||
"esbenp.prettier-vscode", | ||
"mikestead.dotenv", | ||
"ms-playwright.playwright", | ||
"stylelint.vscode-stylelint", | ||
"vue.volar", | ||
"vue.vscode-typescript-vue-plugin" | ||
] | ||
} |
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,25 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"cwd": "${workspaceFolder}", | ||
"name": "App: Web (server-side)", | ||
"request": "launch", | ||
"runtimeArgs": ["run", "dev"], | ||
"runtimeExecutable": "pnpm", | ||
"skipFiles": ["<node_internals>/**"], | ||
"type": "node" | ||
}, | ||
{ | ||
"name": "App: Web (client-side)", | ||
"type": "chrome", | ||
"request": "launch", | ||
"url": "http://localhost:3000" | ||
} | ||
], | ||
"compounds": [ | ||
{ | ||
"name": "App: Web", | ||
"configurations": ["App: Web (server-side)", "App: Web (client-side)"] | ||
} | ||
] | ||
} |
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,38 @@ | ||
{ | ||
"css.validate": false, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"editor.inlayHints.enabled": "offUnlessPressed", | ||
"editor.linkedEditing": true, | ||
"editor.quickSuggestions": { | ||
"strings": true | ||
}, | ||
"editor.rulers": [100], | ||
"eslint.enable": true, | ||
"eslint.validate": ["javascript", "typescript", "vue"], | ||
"files.associations": { | ||
"*.css": "tailwindcss" | ||
}, | ||
"files.eol": "\n", | ||
"html.autoCreateQuotes": false, | ||
"less.validate": false, | ||
"scss.validate": false, | ||
"stylelint.enable": true, | ||
"stylelint.snippet": ["css", "postcss", "tailwindcss", "vue"], | ||
"stylelint.validate": ["css", "postcss", "tailwindcss", "vue"], | ||
"tailwindCSS.validate": true, | ||
"terminal.integrated.enablePersistentSessions": false, | ||
"typescript.enablePromptUseWorkspaceTsdk": true, | ||
"typescript.inlayHints.parameterNames.enabled": "all", | ||
"typescript.preferences.importModuleSpecifier": "non-relative", | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"workbench.editor.labelFormat": "medium", | ||
"[markdown]": { | ||
"editor.wordWrap": "on" | ||
}, | ||
"nuxt.isNuxtApp": false, | ||
"i18n-ally.localesPaths": ["src/messages"] | ||
} |
Oops, something went wrong.