1
0
mirror of synced 2026-01-09 15:02:41 -05:00

Merge branch 'main' into repo-sync

This commit is contained in:
Octomerger Bot
2021-05-18 19:37:05 +10:00
committed by GitHub

View File

@@ -95,9 +95,9 @@ If you have a {% data variables.product.prodname_actions %} workflow that uses a
2. In your {% data variables.product.prodname_actions %} workflow file, update the package url from `https://docker.pkg.github.com` to `ghcr.io`.
3. Add your new {% data variables.product.prodname_container_registry %} authentication personal access token (PAT) as a GitHub Actions secret. The {% data variables.product.prodname_container_registry %} does not support using `GITHUB_TOKEN` for your PAT so you must use a different custom variable, such as `CR_PAT`. For more information, see "[Creating and storing encrypted secrets](/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)."
3. Use the `GITHUB_TOKEN` for your authentication personal access token (PAT). For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow)."
4. In your {% data variables.product.prodname_actions %} workflow file, update the authentication PAT by replacing your Docker registry PAT ({% raw %}`${{ secrets.GITHUB_TOKEN }}`{% endraw %}) with a new variable for your {% data variables.product.prodname_container_registry %} PAT, such as {% raw %}`${{ secrets.CR_PAT }}`{% endraw %}.
4. In your {% data variables.product.prodname_actions %} workflow file, use the authentication token {% raw %}`${{ secrets.GITHUB_TOKEN }}`{% endraw %} as your {% data variables.product.prodname_container_registry %} PAT.
#### Example of updated workflow
@@ -112,12 +112,12 @@ docker push docker.pkg.github.com/github/octoshift/octoshift:$GITHUB_SHA
```
{% endraw %}
Then you'll need to update your workflow with the new {% data variables.product.prodname_container_registry %} URL and PAT like this:
Then you'll need to update your workflow with the new {% data variables.product.prodname_container_registry %} URL like this:
{% raw %}
```yaml
# new login with new container registry url and PAT
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
# new container registry urls added
docker pull ghcr.io/github/octoshift:latest
docker build . --tag ghcr.io/github/octoshift:$GITHUB_SHA --cache-from ghcr.io/github/octoshift:latest