Comments (2)
@nmuianga when using the ${{ secrets.GITHUB_TOKEN }}
placeholder, GitHub automatically injects a short-lived token configured with permissions that depend on what is configured in the workflow. The job in a workflow that is responsible for publishing images must declare the packages: write
permission as follows.
package:
name: Package and Publish
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
security-events: write
The examples in the book follow this setup for publishing images having the following format: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
. In particular, REGISTRY
must be equal to ghcr.io
and IMAGE_NAME
must be exactly the same as the repository name. The GitHub Actions workflows in the book don't need you to create custom Personal Access Tokens since the token automatically provided by GitHub is enough.
There might be reason for which you can't use the automatically provided token. For example, if you need IMAGE_NAME
to be something else than the repository name, but you still want to publish to the GitHub Container Registry (ghcr.io), then you can create a Personal Access Token as described in the book. That token needs the write:packages
scope. Is this your use case?
You can then save the value of the newly generated token into a Secret in your GitHub repository. Since GITHUB_TOKEN
is the name of the token automatically injected by GitHub, your custom token should have a different name to avoid conflicts. Could this be the reason for the error you experienced? In the snippet you shared, I can see that ${{ secrets.GITHUB_TOKEN }}
is used. If you want to use your Personal Access Token (let's say you saved it as a Secret with name MY_CUSTOM_TOKEN
) , then the value passed to the Docker Login action should be ${{ secrets.MY_CUSTOM_TOKEN }}
.
from cloud-native-spring-in-action.
Related Issues (20)
- Fluent bit docker images are not compatible with Apple M2 chips. HOT 2
- Change kubeval by kubeconform HOT 2
- minikube not able to pull images HOT 2
- Issues with Tiltfile HOT 1
- Chapter13 end: connection error from edge-service HOT 4
- Chapter 12 - end. Flyway SQL files without flyway dependency in gradle/pom file HOT 2
- Chapter 2 bug in commit-stage.yaml example HOT 2
- Issues running Keycloak on Digital Ocean Kubernetes cluster HOT 5
- ArgoCD LoadBalancer not provisioning HOT 4
- catalog-service fails when started from docker-compose in chapter 6 when all 3 services including config-service HOT 1
- Chapter 9 minikube addons enable ingress failure in China HOT 4
- Chapter 10.4.3 Exercise Solution:Integration test using real world RabbitMQ broker with testcontainers HOT 2
- [chapter 11.5.2] I am uncertain about the complete overview of the entire workflow. HOT 1
- I find a blemish when I write slice test in chapter 12.3.2 HOT 1
- [Chapter 13.2.2] Why not including RabbitMQ in the computation of the readiness state HOT 2
- Chapter 7: Fails to build docker image with Tilt HOT 2
- Please Create Guide for Setting up a Kubernetes cluster for Polar Bookshop on AWS
- Chapter 2: minikube image load failed HOT 3
- Chapter 15: Fail to deploy ArgoCD to DigitalOcean K8s
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-native-spring-in-action.