-
Describe the bugWhenever the action runs, we get the error Reproduction Steps
Logs
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
The likelihood is that the action is not running within the actual folder where the git directory was established. You may need to change directory before running it, or run the checkout step prior which will handle this for you. |
Beta Was this translation helpful? Give feedback.
-
I'd like to promote this thread to a bug. This action should also work with empty repositories (i.e. making the initial commit on gh-pages). I think you should detect if there's already a repository checked out or not, and act accordingly. Or even better, copy the files to the temp folder first, and initialize a new repository in that temp folder afterwards and leave the environmental repository intact. What if I'd like to use a custom origin, for example? Here is my hotfix for the problem which also presents a use-case: lezsakdomi/gfp-ring-detector@7e84aa7...1628d94 |
Beta Was this translation helpful? Give feedback.
-
Hmm it looks like the yml file in the original post was fixed the same approach I used: Creating an initial commit just to fix the action. |
Beta Was this translation helpful? Give feedback.
-
This action more or less depends on name: Build and Deploy
on: [push]
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
npm ci
npm run build
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy. Alternatively if you use artifacts name: Build and Deploy
on: [push]
jobs:
build:
runs-on: windows-latest # The first job utilizes windows-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
npm ci
npm run build
- name: Upload Artifacts 🔺 # The project is then uploaded as an artifact named 'site'.
uses: actions/upload-artifact@v1
with:
name: site
path: build
deploy:
concurrency: ci-${{ github.ref }}
needs: [build] # The second job must depend on the first one to complete before running and uses ubuntu-latest instead of windows.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Download Artifacts 🔻 # The built project is downloaded into the 'site' folder.
uses: actions/download-artifact@v1
with:
name: site
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: 'site' # The deployment folder should match the name of the artifact. Even though our project builds into the 'build' folder the artifact name of 'site' must be placed here.
If this doesn't resolve the issue for you, please post your logs and try the provided workarounds. |
Beta Was this translation helpful? Give feedback.
-
Closing thread in favour of issue discussion: #1083 |
Beta Was this translation helpful? Give feedback.
This action more or less depends on
actions/checkout
to run prior to it in order for it to establish the git directory in the workspace. If time permits I can look into implementing a fix for this long term so this isn't necessary, or if someone would like to take this task on I'd be happy to support with reviewing and quality checking the release. For an example of what this might look like you can click here, the contribution guide will help you get setup. It mostly just need test coverage, but unfortunately I don't have the time at the minute to finish this up.