Skip to content

Commit

Permalink
fix: update building and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Oct 20, 2024
1 parent 78e122f commit ae59339
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 13 deletions.
41 changes: 35 additions & 6 deletions .github/workflows/lint-and-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,47 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

env:
CI: "true"
STORE_PATH: ""
PNPM_VERSION: 9

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive # TODO:FIXME: this is broken - GH CI Error: fatal: No url found for submodule path 'data/jokes' in .gitmodules
token: ${{ secrets.GH_PAT }}
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: npm ci
run: pnpm i

- name: Lint
run: npm run lint
run: pnpm run lint

analyze:
name: Analyze Code
Expand All @@ -40,13 +67,15 @@ jobs:
language: ["javascript"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_PAT }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
34 changes: 29 additions & 5 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [18.x]
node-version: [22.x]

env:
CI: "true"
STORE_PATH: ""
PNPM_VERSION: 9

steps:
- uses: actions/checkout@v3 # checkout latest commit
- uses: actions/checkout@v4
with:
submodules: recursive

Expand All @@ -27,10 +32,29 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: |
npm i -g tsc
npm ci
pnpm i -g tsc
pnpm i
- name: Run ESLint
run: npm run lint
run: pnpm run lint
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ WORKDIR /app

# Install app dependencies
COPY package.json ./
RUN npm i
RUN npm i -g pnpm
RUN pnpm i

# Copy app source code
COPY . .

# Expose port and start application
EXPOSE 8060
CMD ["npm", "start"]
CMD ["pnpm", "start"]

0 comments on commit ae59339

Please sign in to comment.