Replace the awesome build-and-push functionality we lost with Docker Hub automatically building images from GitHub repos and publishing them.
It appears that the only way to initialize container images on a repo is by building and pushing one locally first.
To do that, you need to authenticate your local Docker install with
- Create a Personal Access Token (PAT) in your GitHub settings -> Developer settings -> Personal Access Token
docker login ghcr.io -u <username>and use the PAT as the password
For each repo
- Build the package locally and push it with
docker build . --tag ghcr.io/<username>/<repo>and
docker push ghcr.io/<username>/<repo>
- Go to
https://ghcr.io/<username>/<repo/in the browser which will redirect you to the page for that package
- Click "Connect Repository" and connect the package to the repo
- Click "Package settings"
- Under "Actions Repository access" click "Add repository", add the repo
- Change the Actions Repository access permission to "Write"
- Under "Danger Zone", change the visibility to Public
- On the repo page, click "Actions" -> "set up a workflow yourself" -> copy and paste
main.ymlbelow into the new action and commit it
- On the repo page, click the gear next to "About" and make sure packages are shown
- Optionally include a build badge in the README like