Hello,
I have a yml using a container to run steps:
runs-on: ubuntu-18.04
container:
image: my-container-on-docker-hub:latest
volumes:
- /github/home/.folder:/github/home/.folder
steps:
- name: ls
run: ls -la $HOME
- uses: actions/upload-artifact@master
with:
name: my-artifact
path: /github/home/.folder
Inside the container if I ls -la /github/home I get:
total 16
drwxr-xr-x 4 1001 115 4096 Sep 12 23:47 .
drwxr-xr-x 4 root root 4096 Sep 12 23:47 ..
drwxr-xr-x 3 root root 4096 Sep 12 23:47 .folder
drwxr-xr-x 2 root root 4096 Sep 12 23:47 .ssh
However the upload-artifact step returns:
Run actions/upload-artifact@master
with:
name: my-artifact
path: /github/home/.folder
##[error]Path does not exist /github/home/.folder
##[error]Exit code 1 returned from process: file name '/home/runner/runners/2.157.3/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Artifact.PublishArtifact, Runner.Plugins"'.
I suspect that upload-artifact runs outside of the container and that's why I tried using volumes to make the data accessible on both sides, but it didn't help.
Is this an issue with volumes or upload-artifact?
Thanks
I'm afraid that I might be facing the same issue. Have you tackled that?
The upload-artifact runs on the host vm, not inside the container, so it can't access $HOME inside the container, please try put anything you want to load under $GITHUB_WORKSPACE, so the upload-artifact can access them.
@TingluoHuang so to my understanding the reason my config is not working is due to some issue in container.volumes since this is supposed to map (and sync I guess) the host folder with the container folder. Is that right?
I'm afraid that I might be facing the same issue. Have you tackled that?
@mballoni looking at https://github.com/mballoni/boot-validator/commit/cc2a9595750d01d99568ab816c55fa60272fc9e6 I think that your issue is #3, since i don't see any containers in your workflow.
@zakkak yes, map a host folder into container.
Uploading an artifact from a container should now work with the v2-preview
v2 upload artifact has been released! https://github.blog/changelog/2020-04-28-github-actions-v2-artifact-actions/
Upload and download should now work properly in containers
Most helpful comment
v2upload artifact has been released! https://github.blog/changelog/2020-04-28-github-actions-v2-artifact-actions/Upload and download should now work properly in containers