4

I am using GitHub Actions and have 2 jobs, one that uploads a folder, and another that will create an image using that folder.

Job 1:

- name: Upload Build
  uses: actions/upload-artifact@v1
    with:
      name: StandaloneLinux64
      path: build/StandaloneLinux64

Job 2:

- uses: actions/download-artifact@v1
  with:
    name: StandaloneLinux64
    path: Docker/StandaloneLinux64

Will this add an archive (zip/tar/tar.gz) or will this recreate the folder structure? I have looked at the documentation but i couldn't find a place where it was made clear.

Redline
  • 441
  • 8
  • 20
  • 1
    Why not try it? If the docs didn't state it will be archived, it probably wont be archived. – DannyB Feb 04 '20 at 20:54
  • @DannyB the work flow is a lot more complicated with forks, and secrets. Also, so if I don't get an answer I can test it and answer it for others. – Redline Feb 04 '20 at 21:19

2 Answers2

6

I tested it and if you upload a folder and then download it again using GitHub Actions, it recreates the original structure that was uploaded with the given path as the base.

But it does not recreate the parent folder as documented here: GitHub Actions: Changes to artifact download experience.

It does not, as i was worrying about, download the artifact as an archive.

Redline
  • 441
  • 8
  • 20
1

You can see an example in the documentation here, where it shows that download-artifact unpacks the archive back into it's original directory structure.

This is the relevant part of the example workflow where it downloads the homework artifact and math-homework.txt is already unpacked and accessible in the next step:

    steps:
      - name: Download math result for job 1
        uses: actions/download-artifact@v1
        with:
          name: homework
      - shell: bash
        run: |
          value=`cat homework/math-homework.txt`
          expr $value \* 9 > homework/math-homework.txt
peterevans
  • 34,297
  • 7
  • 84
  • 83
  • In the example they upload a file, `math-homework.txt` not a folder. Which was my question, what would happen if a folder, not a file was up/downloaded. But i found it out by testing. – Redline Feb 05 '20 at 13:34