atirikt / github-actions-for-ci

https://lab.github.com/githubtraining/github-actions:-continuous-integration
MIT License
0 stars 0 forks source link

Improve CI #6

Closed atirikt closed 2 years ago

github-learning-lab[bot] commented 2 years ago

Use the upload

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.

Step 11: Upload a job's build artifacts

icon of a binary file

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.

  1. Edit your workflow file
  2. Add a step to your 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/
  3. Commit your change to this branch

I'll respond when you commit to this branch.

github-learning-lab[bot] commented 2 years ago

Use the upload

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.

Step 11: Upload a job's build artifacts

icon of a binary file

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.

  1. Edit your workflow file
  2. Add a step to your 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/
  3. Commit your change to this branch

I'll respond when you commit to this branch.