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

[CI] Add workflow to push Docker image to Dockerhub and ECR #37

Merged
merged 5 commits into from
Jan 7, 2021

Conversation

ErikSchierboom
Copy link
Member

This PR adds a GitHub Actions workflow to automatically push a new version of this repo's Docker image to both Dockerhub and ECR.
The former is used when running the tooling on your local machine using the development environment, the latter is currently used when running the tooling on our staging environment (https://exercism.lol/) but will eventually be used for our production website.

We've sent PRs to tooling repos before related to this functionality, but those PRs added two separate workflows for pushing to Dockerhub and ECR. With this PR, these workflows have been merged into a single workflow, which is much more efficient. If present, the old workflows will be removed in this PR.

See exercism/v3#2969

@ErikSchierboom ErikSchierboom requested a review from a team as a code owner January 6, 2021 14:50
@ErikSchierboom
Copy link
Member Author

@ynfle It looks like you don't have review permissions for this repo. Would you be interested in having those permissions?

Copy link
Member

@ee7 ee7 left a comment

Choose a reason for hiding this comment

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

Nice - this PR also upgrades docker/build-push-action to v2.

And it's great that this uses actions/cache rather than satackey/action-docker-layer-caching, which caused some CI errors previously (see https://github.com/exercism/nim-test-runner/runs/1382436417).

Approved, conditional on the docker/build-push-action version number being fixed.

.github/workflows/docker.yml Outdated Show resolved Hide resolved
.github/workflows/docker.yml Outdated Show resolved Hide resolved
.github/workflows/docker.yml Outdated Show resolved Hide resolved
.github/workflows/docker.yml Show resolved Hide resolved
branches: [main, master]

jobs:
multiple-registries:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
multiple-registries:
multiple-registries:

Non-blocking comment: I think this name could be better.

.github/workflows/docker.yml Outdated Show resolved Hide resolved
@ee7 ee7 mentioned this pull request Jan 7, 2021
4 tasks
@ynfle
Copy link
Contributor

ynfle commented Jan 7, 2021

@ynfle It looks like you don't have review permissions for this repo. Would you be interested in having those permissions?

Which permissions? Didn't I used to have permissions?

@ErikSchierboom
Copy link
Member Author

Hmmm, there is something weird here. Both of you have approved, but they don't count as approving reviews. @iHiD could you check if the permissions are correct for @ee7 and @ynfle?

@ee7
Copy link
Member

ee7 commented Jan 7, 2021

Hmmm, there is something weird here. Both of you have approved, but they don't count as approving reviews.

Isn't it just because the CODEOWNERS file contains this?

* @exercism/maintainers-admin

Maybe a member of that team has to approve even when the PR was created by somebody in that team?

check if the permissions are correct for ee7 and ynfle

From the GitHub API I can confirm that the permissions in this repo are:

Permission Users
push and pull ee7, ynfle, ErikSchierboom
admin iHiD, kytrinyx

@ErikSchierboom ErikSchierboom merged commit 7f85413 into master Jan 7, 2021
@ErikSchierboom ErikSchierboom deleted the docker-workflow branch January 7, 2021 12:51
ee7 referenced this pull request in ee7/exercism-nim-test-runner Jan 8, 2021
Commit 7f85413 (#37) added a workflow that pushes images to Amazon
ECR and Docker Hub, but the deployment job also ran on forks. This meant
that a push to the `master` branch of a fork would produce a failing CI
check.

This commit causes the deployment job to be skipped on forks.
ee7 added a commit that referenced this pull request Jan 8, 2021
Commit 7f85413 (#37) added a workflow that pushes images to Amazon
ECR and Docker Hub, but the deployment job also ran on forks. This meant
that a push to the `master` branch of a fork would produce a failing CI
check.

This commit causes the deployment job to be skipped on forks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants