build makes dist/catalogue.txt, and its machine is thrown away when the job ends. To keep a file, upload it as an artifact: a named bundle of files stored with the run.
- uses: actions/upload-artifact@v7
with:
name: catalogue
path: dist/with: gives an action its inputs. path: is what to upload. For a folder, its contents are stored, not the folder itself: the artifact holds catalogue.txt, not dist/catalogue.txt.
Another job can download it. It must wait for build with needs:, or the artifact isn't there yet:
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
name: catalogue
- run: cat catalogue.txtgh run download
Downloads a run's artifact into the current folder. Without -n, every artifact of the run, each in a folder of its name. gh run view <run-id> lists them under ARTIFACTS.
gh run download <run-id> -n catalogueObjectives
- Hand the catalogue on to another job.
- Download it to devbox.