-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files excluded in .gitignore
files?
#16
Comments
Ok, I managed to get my CI process working, but no solution to this problem yet. When rsync runs on the runners runtime, it is able to find and sync those files. |
Hello @cwilby, thank's for reaching out. It is interesting to know that all your intended files are synced when running the action on the runners runtime but not on your self-hosted runner. |
Thanks for responding - here is the build step, the switches are
|
I've discovered the issue is related to running self hosted runners using Docker, where the runner container shares a Docker daemon with the host. The issue is that the when the volume is mounted to the container that runs this action, the mount point is from the host operating systems perspective, not the runner containers perspective (which contains the build output). This is only a problem when running self hosted runners using Docker. |
FYI - I found a solution I'm happy with 🎉 A GitHub workflow has many Jobs, and each Job can specify which runner it should run on. Instead of one job, I now run Test/Build on the self hosted runner, and Deploy on a GitHub hosted runner. The Build script uses https://github.com/actions/upload-artifact to upload the build output to the workflow. The Deploy script uses https://github.com/actions/download-artifact to download the build output from the workflow, and then uses this rsync action successfully to push to environments. |
Congrats @cwilby for solving this issue and for investigating. I am glad you figured it out and thank you for your contribution! I have pinned this issue and added the documentation label, in case anyone else runs into the same problem. Have a great week, |
Additionally using https://github.com/marketplace/actions/delete-artifact to delete artifacts at the end of each build (I don't need to keep them around) to prevent taking up space I don't need. |
I'm currently building a workflow using self-hosted runners for a Laravel application to automatically:
npm run build
on a self hosted actions runner, populating./public/*
folders../public/*
from the runner to/var/www/public/*
on the web server using thisrsync
action.The issue at the moment is that the build output is not being transferred to the web server.
To go back a bit - to make this work, I added a
.gitignore
file to each folder in./public/*
. This is because the server pulls the latest changes via Git, which would create conflicts if the build output were included in source control.This keeps the structure of the public directory in source control, but not the files. When a build succeeds, those files are "rsync-ed" to the server.
A strange thing is that the
.gitignore
files are being copied to the web server, just not the files that would be ignored.Verification that runner has the build output
rsync
outputI am expecting to see
mix-manifest.json
in this output.The text was updated successfully, but these errors were encountered: