Skip to content
Snippets Groups Projects
Commit 843806ea authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Switch to npm

parent b0cd6836
No related branches found
No related tags found
No related merge requests found
......@@ -11,3 +11,4 @@ dist
config.local.js
basement_dist
.idea/
yarn.lock
\ No newline at end of file
......@@ -3,10 +3,10 @@ image: registry.gitlab.tugraz.at/dbp/website/main:v1
cache:
key: $CI_PROJECT_PATH
paths:
- _yarn_cache
- _npm_cache
before_script:
- yarn config set cache-folder "$CI_PROJECT_DIR/_yarn_cache"
- npm config set cache "$CI_PROJECT_DIR/_npm_cache"
stages:
- test
......@@ -17,8 +17,8 @@ test:
- schedules
stage: test
script:
- yarn install
- yarn run build
- npm ci
- npm run build
test_links:
allow_failure: true
......@@ -26,30 +26,14 @@ test_links:
- schedules
stage: test
script:
- yarn install
- yarn run check-links
.deploy_defaults: &deploy_defaults
except:
- schedules
stage: deploy
script:
# Add ssh key
- mkdir -p ~/.ssh
- echo "${DEPLOY_KEY}" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
# Deploy
- dep deploy --file ./.gitlab-ci/deploy.php "${CI_ENVIRONMENT_NAME}"
- echo "Deployed to ${CI_ENVIRONMENT_URL}"
# Simple health check
- curl --max-time 10 --retry 3 --output /dev/null --silent --show-error --fail --location "${CI_ENVIRONMENT_URL}"
- npm ci
- npm run check-links
check-links:
only: [schedules]
script:
- yarn install
- yarn run check-links
- npm ci
- npm run check-links
deploy:
stage: deploy
......
......@@ -11,12 +11,8 @@ RUN apt-get update && apt-get install -y \
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y \
nodejs \
yarn \
sudo \
&& rm -rf /var/lib/apt/lists/*
......
FROM node:16-alpine as node
COPY . /build
WORKDIR /build
RUN yarn install
RUN yarn run build
RUN npm ci
RUN npm run build
FROM nginx:latest
COPY --from=node /build/src/.vuepress/dist /usr/share/nginx/html
......
......@@ -12,10 +12,10 @@ git clone git@gitlab.tugraz.at:dbp/handbook.git
cd website
# install dependencies (node>=12 is needed)
yarn install
npm install
# run dev server
yarn run dev
npm run dev
```
Open <http://0.0.0.0:8080/>.
......@@ -25,6 +25,6 @@ Open <http://0.0.0.0:8080/>.
In case building fails with openssl v3:
```
yarn run dev3
yarn run build3
npm run dev3
npm run build3
```
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment