Skip to content
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

Publish docker image only when secrets are available #140

Merged
merged 1 commit into from
Dec 23, 2022

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Dec 23, 2022

See: #132 (reply in thread)

https://hub.docker.com/ does not have scoped tokens. They only have personal tokens. If you want to deploy the docker image with a workflow, you have to use your personal token.

To avoid sharing your personal tokens with all the maintainers, we agreed on using forks. I've changed the workflow. now it is only executed if the secret "DOCKER_HUB_USERNAME" is set in the "dockerhub-torrust" environment.

We can disable the workflow in this repo just by deleting the env vars:

  • DOCKER_HUB_USERNAME
  • DOCKER_HUB_REPOSITORY_NAME
  • DOCKER_HUB_ACCESS_TOKEN

I only check for DOCKER_HUB_USERNAME.

We can use the same approach for publishing the crate on https://crates.io

Since dockerhun does not allow scoepd token, we are going to use forks
to publish docker images. The "publisher" can set their token on their
forks.

The workflow is executed only if the secret "DOCKER_HUB_USERNAME" is
set in the environment "dockerhub-torrust"
Copy link
Contributor

@da2ce7 da2ce7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e4b2a8e

@josecelano josecelano merged commit ead2a0c into torrust:develop Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants