Skip to content

Commit

Permalink
add ci linter
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbitfly committed Mar 1, 2024
1 parent c1adac8 commit 5d6e409
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/frontend-lint-format.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
name: Lint & Format
name: Frontend Linter

# TODO frontend
on:
push:
paths:
- 'frontend/**'
branches:
- master
- staging
- main
- add_frontend_dockerfile
pull_request:
paths:
- 'frontend/**'
branches:
- staging
- master
- '*'

jobs:
lint-format:
name: lint-format
frontend-lint:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node Environment
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install Dependencies
run: npm ci
- name: Check File Format
run: npm run check-format
working-directory: frontend
env:
FA_PRO_KEY: ${{ secrets.FA_PRO_KEY }}
run: npm --userconfig=".npmrc_ci" ci
- name: Lint Files
run: npm run check-style
working-directory: frontend
run: npm run lint
1 change: 1 addition & 0 deletions frontend/.npmrc_ci
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//npm.fontawesome.com/:_authToken=${FA_PRO_KEY}
19 changes: 19 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18-alpine AS build

RUN mkdir -p /usr/src/nuxt-app
WORKDIR /usr/src/nuxt-app
COPY . .

RUN echo "//npm.fontawesome.com/:_authToken=${FA_PRO_KEY}" > .npmrc && npm ci && npm cache clean --force && rm -f .npmrc
RUN npm run build

FROM node:18-alpine
WORKDIR /usr/src/nuxt-app
COPY --from=build /usr/src/nuxt-app /usr/src/nuxt-app

ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=3000

EXPOSE 3000

ENTRYPOINT ["node", ".output/server/index.mjs"]

0 comments on commit 5d6e409

Please sign in to comment.