Are you looking for something? Here is all of the GitHub Docs history in one single commit. Enjoy! 🎉
4.8 KiB
title, intro, product, redirect_from, versions
| title | intro | product | redirect_from | versions | |||||
|---|---|---|---|---|---|---|---|---|---|
| Using GitHub Packages with GitHub Actions | You can configure a workflow in {{ site.data.variables.product.prodname_actions }} to automatically publish or install a package from {{ site.data.variables.product.prodname_registry }}. | {{ site.data.reusables.gated-features.packages }} |
|
|
{{ site.data.reusables.package_registry.packages-ghes-release-stage }}
About {{ site.data.variables.product.prodname_registry }} with {{ site.data.variables.product.prodname_actions }}
{{ site.data.reusables.repositories.about-github-actions }} {{ site.data.reusables.repositories.actions-ci-cd }} For more information, see "About {{ site.data.variables.product.prodname_actions }}."
You can extend the CI and CD capabilities of your repository by publishing or installing packages as part of your workflow.
{% if currentVersion == "free-pro-team@latest" %}
Authenticating to {{ site.data.variables.product.prodname_github_container_registry }}
{{ site.data.reusables.package_registry.container-registry-beta }}
{{ site.data.reusables.package_registry.authenticate_with_pat_for_container_registry }}
For an authentication example, see "Authenticating with the {{ site.data.variables.product.prodname_container_registry }}."
{% endif %}
Authenticating to package registries on {{ site.data.variables.product.prodname_dotcom }}
{% if currentVersion == "free-pro-team@latest" %}If you want your workflow to authenticate to {{ site.data.variables.product.prodname_registry }} to access a package registry other than the {{ site.data.variables.product.prodname_container_registry }} on {{ site.data.variables.product.product_name }}, then{% else %}To authenticate to package registries on {{ site.data.variables.product.product_name }},{% endif %} we recommend using the GITHUB_TOKEN that {{ site.data.variables.product.product_name }} automatically creates for your repository when you enable {{ site.data.variables.product.prodname_actions }} instead of a personal access token for authentication. The GITHUB_TOKEN has read:packages and write:packages scopes to the current repository. For forks, the token also has the read:packages scope for the parent repository.
You can reference the GITHUB_TOKEN in your workflow file using the {% raw %}{{secrets.GITHUB_TOKEN}}{% endraw %} context. For more information, see "Authenticating with the GITHUB_TOKEN."
Publishing a package using an action
You can publish packages as part of your continuous integration (CI) flow using {{ site.data.variables.product.prodname_actions }}. For example, you could configure a workflow so that anytime a developer pushes code to the default branch, the workflow runs CI tests. If those tests pass, the workflow publishes a new package version to {{ site.data.variables.product.prodname_registry }}. This workflow automates the creation of new package versions only if the code meets your quality standards.
{{ site.data.reusables.package_registry.actions-configuration }}
Installing a package using an action
You can install packages as part of your CI flow using {{ site.data.variables.product.prodname_actions }}. For example, you could configure a workflow so that anytime a developer pushes code to a pull request, the workflow resolves dependencies by downloading and installing packages hosted by {{ site.data.variables.product.prodname_registry }}. Then, the workflow can run CI tests that require the dependencies.
Installing packages hosted by {{ site.data.variables.product.prodname_registry }} through {{ site.data.variables.product.prodname_actions }} requires minimal configuration or additional authentication when you use GITHUB_TOKEN.{% if currentVersion == "free-pro-team@latest" %} Data transfer is also free when an action installs a package. For more information, see "About billing for {{ site.data.variables.product.prodname_registry }}."{% endif %}
{% if currentVersion == "free-pro-team@latest" %}
GITHUB_TOKEN cannot install packages from any private repository besides the repository where the action runs. You cannot currently use GITHUB_TOKEN to authenticate to {{ site.data.variables.product.prodname_github_container_registry }}.
{% endif %}
{{ site.data.reusables.package_registry.actions-configuration }}