Home > Development Tools > git > body text

how to publish artifact in github actions

Patricia Arquette
Release: 2024-10-10 12:41:16
Original
1058 people have browsed it

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>
Copy after login

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>
Copy after login

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>
Copy after login

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>
Copy after login

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!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template