diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index c240cd8..21865a0 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -1,12 +1,32 @@ -name: CI/CD Workflow +name: CI/CD on: push: - branches: - - main jobs: + ci: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install dependencies + run: yarn install + + - name: Lint + run: yarn lint + + - name: Test + run: yarn test + build-and-push: + needs: ci + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: @@ -35,6 +55,14 @@ jobs: push: true tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:app + - name: Build base image + uses: docker/build-push-action@v2 + with: + context: . + file: ./quests/Dockerfile + push: false + tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:base + - name: Build quest helloworld uses: docker/build-push-action@v2 with: diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 01f475e..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: ESLint Checks - -on: - push: - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: Install dependencies - run: yarn install - - - name: Lint - run: yarn lint diff --git a/.gitignore b/.gitignore index a389d25..8534ca9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ lerna-debug.log* .bash_history .viminfo *.swp +home # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/app/Dockerfile b/app/Dockerfile index dd77845..30a17f7 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,14 +1,18 @@ # Build stage FROM node as build-stage WORKDIR /app -COPY app/package.json yarn.lock ./ -RUN yarn install -COPY app . +COPY package.json yarn.lock ./ +COPY app/package.json ./app/package.json +COPY packages/file-graph/package.json ./packages/file-graph/package.json +RUN yarn install --frozen-lockfile + +COPY app ./app +COPY packages/file-graph ./packages/file-graph RUN yarn build # Production stage FROM nginx:stable-alpine as production-stage -COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY --from=build-stage /app/app/dist /usr/share/nginx/html COPY deployment/nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/app/Dockerfile.dev b/app/Dockerfile.dev index 61d9568..a58a1cc 100644 --- a/app/Dockerfile.dev +++ b/app/Dockerfile.dev @@ -1,7 +1,10 @@ FROM node WORKDIR /app -COPY app/package.json yarn.lock ./ +COPY package.json yarn.lock ./ +COPY app/package.json ./app/package.json +COPY packages/file-graph/package.json ./packages/file-graph/package.json RUN yarn install --frozen-lockfile -COPY app . + +WORKDIR /app/app CMD [ "yarn", "dev:docker", "--host", "0.0.0.0" ] \ No newline at end of file diff --git a/app/package.json b/app/package.json index 8f5147c..4381231 100644 --- a/app/package.json +++ b/app/package.json @@ -11,6 +11,7 @@ "preview": "vite preview" }, "dependencies": { + "@linux-odyssey/file-graph": "*", "@fortawesome/fontawesome-svg-core": "^6.4.0", "@fortawesome/free-brands-svg-icons": "^6.4.0", "@fortawesome/free-regular-svg-icons": "^6.4.0", diff --git a/app/src/components/FileNode.vue b/app/src/components/FileNode.vue new file mode 100644 index 0000000..ee4636e --- /dev/null +++ b/app/src/components/FileNode.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/src/components/QuestPart.vue b/app/src/components/QuestPart.vue index 933d1d8..8e6a46f 100644 --- a/app/src/components/QuestPart.vue +++ b/app/src/components/QuestPart.vue @@ -1,19 +1,19 @@