Closed atirikt closed 2 years ago
The workflow has finished running!
You may notice build
succeeded, but each of the test
jobs failed. That's because the build artifacts created in build
aren't available to the test
job. Each job executes in a fresh instance of the virtual environment. This is due to the design of the virtual environments themselves.
So what do we do when we need the work product of one job in another? We can use the built-in artifact storage to save artifacts created from one job to be used in another job within the same workflow.
Artifacts allow you to persist data after a job has completed, and share that data with another job in the same workflow. An artifact is a file or collection of files produced during a workflow run.
To upload artifacts to the artifact storage, we can use an action built by GitHub: actions/upload-artifacts
.
You can follow the manual steps below, or accept the suggestion in the following comment.
build
job that uses the upload-artifacts
action.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install and build webpack
run: |
npm install
npm run build
- uses: actions/upload-artifact@main
with:
name: webpack artifacts
path: public/
I'll respond when you commit to this branch.
Use the upload
The workflow has finished running!
You may notice
build
succeeded, but each of thetest
jobs failed. That's because the build artifacts created inbuild
aren't available to thetest
job. Each job executes in a fresh instance of the virtual environment. This is due to the design of the virtual environments themselves.So what do we do when we need the work product of one job in another? We can use the built-in artifact storage to save artifacts created from one job to be used in another job within the same workflow.
Step 11: Upload a job's build artifacts
Artifacts allow you to persist data after a job has completed, and share that data with another job in the same workflow. An artifact is a file or collection of files produced during a workflow run.
To upload artifacts to the artifact storage, we can use an action built by GitHub:
actions/upload-artifacts
.:keyboard: Activity: Use the upload action in your workflow file to save a job's build artifacts
You can follow the manual steps below, or accept the suggestion in the following comment.
build
job that uses theupload-artifacts
action.I'll respond when you commit to this branch.