s0 / git-publish-subdir-action

GitHub Action to push a subdirectory as a branch to any git repo (e.g. for GitHub Pages)
https://github.com/marketplace/actions/push-git-subdirectory-as-branch
MIT License
208 stars 36 forks source link

dist folder not found on deploy #97

Closed Tpleme closed 7 months ago

Tpleme commented 11 months ago

Hello, I've just recently started to work with github actions, and i am trying to automate the build and deploy to a new branch of a vite project. But i am getting an error about not finding the dist folder after build step is performed.

Detail to note: The project to build is inside a folder named "client".

This is my workflow file:

name: Generate a build and deploy to production

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build
    defaults:
        run:
          working-directory: ./client
    steps:
      - name: git-checkout
        uses: actions/checkout@v2

      - name: Install all dependencies
        run: npm install

      - name: Build
        run: npm run build

      - name: Deploy
        uses: s0/git-publish-subdir-action@develop
        env:
          REPO: self
          BRANCH: production
          FOLDER: dist
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 
          MESSAGE: "Build: ({sha}) {msg}"

Only the deploy step fail with this error:

image

What am i doing wrong in the workflow configuration?

Tpleme commented 7 months ago

I solved this by passing the path ./client/dist to the FOLDER param. Seems like setting working directory doesn't affect this action