简体   繁体   中英

Does GitHub Actions download-artifact create an archive or folder structure?

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM