From a90f8d01e2c365d1df1c92dfb08136c8e039e148 Mon Sep 17 00:00:00 2001 From: fechan Date: Mon, 6 May 2024 18:21:53 -0700 Subject: [PATCH] add working directory arg to action --- .../deploy-vite-to-ghpages.yml | 12 ++++++++++++ .github/workflows/deploy-vite-to-ghpages.yml | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/actions/deploy-vite-to-ghpages/deploy-vite-to-ghpages.yml b/.github/actions/deploy-vite-to-ghpages/deploy-vite-to-ghpages.yml index 272ce5a..ce4d3ac 100644 --- a/.github/actions/deploy-vite-to-ghpages/deploy-vite-to-ghpages.yml +++ b/.github/actions/deploy-vite-to-ghpages/deploy-vite-to-ghpages.yml @@ -4,22 +4,34 @@ author: 'fechan' branding: color: blue icon: code +inputs: + working-directory: + description: Working directory for this action + required: true runs: using: 'composite' steps: - run : npm i + working-directory: ${{ inputs.working-directory }} shell: bash - run : npm ci + working-directory: ${{ inputs.working-directory }} shell: bash - run : vite build + working-directory: ${{ inputs.working-directory }} shell: bash - run : git config user.name github-actions + working-directory: ${{ inputs.working-directory }} shell: bash - run : git config user.email github-actions@github.com + working-directory: ${{ inputs.working-directory }} shell: bash - run : git --work-tree build add --all + working-directory: ${{ inputs.working-directory }} shell: bash - run : git commit -m "Automatic Deploy action run by github-actions" + working-directory: ${{ inputs.working-directory }} shell: bash - run : git push origin HEAD:gh-pages --force + working-directory: ${{ inputs.working-directory }} shell: bash \ No newline at end of file diff --git a/.github/workflows/deploy-vite-to-ghpages.yml b/.github/workflows/deploy-vite-to-ghpages.yml index 867c862..5246006 100644 --- a/.github/workflows/deploy-vite-to-ghpages.yml +++ b/.github/workflows/deploy-vite-to-ghpages.yml @@ -16,4 +16,5 @@ jobs: - name: Deploy react app to github pages uses: ./.github/actions/deploy-vite-to-ghpages - working-directory: ./client \ No newline at end of file + with: + working-directory: ./client \ No newline at end of file