Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispose develop branch #52

Merged
merged 8 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish package to npm

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json
cache: npm
cache-dependency-path: package-lock.json
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm clean-install --prefer-offline --ignore-scripts

- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
62 changes: 50 additions & 12 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,61 @@ name: Check pull request

on:
pull_request:
branches: [develop]
branches: [main]

jobs:
test:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json
cache: npm
cache-dependency-path: package-lock.json

- name: Install Node.js dependencies
run: npm ci --prefer-offline --ignore-scripts

- name: Check code formatting
run: npx prettier --check .

- name: Compile TypeScript
run: npm run build

- name: Run unit-tests
run: npm test

run-schematics:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
node-version-file: package.json
cache: npm
cache-dependency-path: package-lock.json
- run: npm ci --prefer-offline --ignore-scripts
name: Install Node.js dependencies
- run: npx prettier --check .
name: Check code formatting
- run: npm run build
name: Compile TypeScript
- run: npm test
name: Run unit-tests

- name: Install NestJS CLI globally
run: npm install --global @nestjs/cli@^10

- name: Install schematics globally
run: |
npm ci --prefer-offline --ignore-scripts
npm run build
npm install --global .

- name: Test generating a new NestJS application
run: >
nest new test-app --dry-run
--package-manager npm
--collection @tseisel/nestjs-schematics
timeout-minutes: 1
29 changes: 0 additions & 29 deletions .github/workflows/run-schematics.yml

This file was deleted.

6 changes: 4 additions & 2 deletions src/docker/files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ ENTRYPOINT [ "dumb-init", "--" ]
FROM base as development
# Install Node.js development dependencies
COPY package*.json ./
RUN npm clean-install --ignore-scripts --prefer-offline --no-audit
RUN --mount=type=cache,id=npm,target=/root/.npm \
npm clean-install --ignore-scripts --prefer-offline --no-audit
# Run application in development mode
CMD [ "npx", "nest", "start", "--watch", "--debug", "0.0.0.0:9229" ]

Expand All @@ -21,7 +22,8 @@ FROM base as production
# Install Node.js production dependencies
ENV NODE_ENV=production
COPY package*.json ./
RUN npm clean-install --ignore-scripts --prefer-offline --no-audit
RUN --mount=type=cache,id=npm,target=/root/.npm \
npm clean-install --ignore-scripts --prefer-offline --no-audit
# Run application in production mode
COPY --from=builder /usr/src/app/dist ./dist
CMD [ "node", "--enable-source-maps", "dist/main.js" ]
2 changes: 0 additions & 2 deletions src/docker/files/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3"

services:
api:
build:
Expand Down
Loading