0

As the title suggests, I am building a MEVN (Vue) Stack application and am facing this issue:

Earlier to this, I had been only building the frontedn part of my app & it was successfully getting deployed. Only when did I integrate my backend & changed the folder structure a bit, did I start getting these errors.

Below is my Deploy.yml :

name: Deploy

on:
  push:
    branches:
      - main

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v2

      - name: Setup Node
        uses: actions/setup-node@v1
        with:
          node-version: 16

      - name: Install dependencies
        uses: bahmutov/npm-install@v1

      - name: Build project
        run: npm run build --prefix client

      - name: Upload production-ready build files
        uses: actions/upload-artifact@v2
        with:
          name: production-files
          path: ./dist

  deploy:
    name: Deploy
    needs: build
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'

    steps:
      - name: Download artifact
        uses: actions/download-artifact@v2
        with:
          name: production-files
          path: ./dist

      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./dist

Please help.

Vivek Hotti
  • 69
  • 2
  • 9
  • `npm run build --prefix client` does this command put files into `./dist`? What does `prefix` mean? – rethab Jun 23 '22 at 14:55
  • No, so this deploy.yml is in my root folder. My folder structure looks something like this: `- client, - server`. `--prefix` is a statement that helps git to know that it has to perform the npm run build command in the client folder because there is where my frontend is. – Vivek Hotti Jun 24 '22 at 03:54
  • Have you tried changing the `path` in the upload action to `./client/dist`? – rethab Jun 24 '22 at 05:44
  • Ok so now the Build & Deploy was successfull according to github actions. But the github page shows a 404 error (Page not found). – Vivek Hotti Jun 24 '22 at 09:25
  • Please create a new question for a new problem. – rethab Jun 25 '22 at 11:04

0 Answers0