-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pushing docker images to GitHub Container Registry rather than DockerHub #291
base: develop
Are you sure you want to change the base?
Pushing docker images to GitHub Container Registry rather than DockerHub #291
Conversation
- name: Push image | ||
env: | ||
DOCKERHUB_ACCOUNT: ${{ secrets.DOCKERHUB_ACCOUNT }} | ||
DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_REPO }} | ||
GITHUB_ACCOUNT: ${{ secrets.GITHUB_ACCOUNT }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to somehow infer the github account name from the variables the this action is triggered with? I imagine the opencrvs
is available somewhere when the repository the pipeline is in is opencrvs/opencrvs-countryconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's possible to use the default environment variables and infer the github account rather than hard-coding it! Let me refactor!
DOCKERHUB_ACCOUNT: ${{ secrets.DOCKERHUB_ACCOUNT }} | ||
DOCKERHUB_REPO: ${{ secrets.DOCKERHUB_REPO }} | ||
GITHUB_ACCOUNT: ${{ secrets.GITHUB_ACCOUNT }} | ||
GH_CONTAINER_REGISTRY_REPO: ${{ secrets.GH_CONTAINER_REGISTRY_REPO }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this also default to something like the name of this current repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sure!
password: ${{ secrets.DOCKER_TOKEN }} | ||
registry: ghcr.io | ||
username: ${{ env.GITHUB_ACCOUNT }} | ||
password: ${{ secrets.GH_PAT}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could replace this with GH_TOKEN too which is currently collected from the developer as part of the "setup environment" script 🤔
password: ${{ secrets.GH_PAT}} | |
password: ${{ secrets.GH_TOKEN}} |
Looking good! Can't wait to try this out. As part of the server setup process, we ask countries to run a "setup environment" script that effectively creates all environment variables on Github. This happens before servers get provisioned. You can read about it from here. I think this change needs to also change which variables we collect here: There might be other places like this too. I suggest searching the country config codebase with |
No description provided.