Home  >  Article  >  Development Tools  >  how to publish artifact in github actions

how to publish artifact in github actions

Patricia Arquette
Patricia ArquetteOriginal
2024-10-10 12:41:16997browse

In GitHub Actions, artifacts enable sharing data among workflow jobs. Using the upload-artifact action, users can publish a single artifact with name and path parameters, while for multiple artifacts, they can utilize the upload-artifacts action spec

how to publish artifact in github actions

How to publish artifact in github actions?

Yes, you can publish artifacts in GitHub Actions. To publish an artifact, you can use the upload-artifact action. The syntax for the upload-artifact action is as follows:

<code class="yaml">- uses: actions/upload-artifact@v2
  with:
    name: artifact-name
    path: path-to-artifact</code>

For example, the following code publishes an artifact named my-artifact with the contents of the dist directory:

<code class="yaml">- uses: actions/upload-artifact@v2
  with:
    name: my-artifact
    path: dist</code>

How to publish multiple artifacts in github actions?

To publish multiple artifacts in GitHub Actions, you can use the upload-artifacts action. The syntax for the upload-artifacts action is as follows:

<code class="yaml">- uses: actions/upload-artifacts@v2
  with:
    artifacts: artifact-paths</code>

For example, the following code publishes two artifacts, my-artifact1 and my-artifact2:

<code class="yaml">- uses: actions/upload-artifacts@v2
  with:
    artifacts: dist/my-artifact1.zip,dist/my-artifact2.zip</code>

Can you publish artifacts in github actions?

Yes, you can publish artifacts in GitHub Actions. To publish an artifact, you can use the upload-artifact action or the upload-artifacts action.

The above is the detailed content of how to publish artifact in github actions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn