Last active
October 13, 2024 11:14
-
-
Save ndamulelonemakh/af5dec1eef63dfbccbb6cdcb2f9f76f5 to your computer and use it in GitHub Desktop.
Convenience script to push images to Github container registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# Pre-requisite: | |
# Generate your token at: https://github.com/settings/tokens/new?scopes=write:packages | |
# More info: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry | |
export CR_PAT=<YOUR_TOKEN> | |
GITHUB_USERNAME=<your-github-account-name> | |
echo $CR_PAT | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin | |
IMAGE_NAME=<the-name-of-your-image> | |
docker push ghcr.io/$GITHUB_USERNAME/$IMAGE_NAME:latest | |
# Access the image at: https://github.com/GITHUB_USERNAME?ecosystem=all&tab=packages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment