Skip to content

Commit

Permalink
Refactor release CI process to use new Github Docker Registry
Browse files Browse the repository at this point in the history
Github has launched the new Docker Registry which is better integrated
with Github Projects and the naming convention is less confusing. Also
the way GH Packages Docker publish was configured, that is deprecated in
the new version of build and push. So moving to the new registry is the
way forward.

Update the docker registry URL.

Signed-off-by: Imran M Yousuf <imyousuf@gmail.com>
  • Loading branch information
imyousuf committed Jan 26, 2021
1 parent 326778b commit 4c9b84b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,27 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
uses: docker/login-action@v1
name: Login to Github Docker Registry
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

-
uses: docker/build-push-action@v2
name: Push to Dockerhub
id: dockerhub_build_push
name: Push
id: build_push
with:
push: true
tags: |
imyousuf/webhook-broker:${{ steps.get_version.outputs.VERSION }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: imyousuf/webhook-broker/w7b6
tag_with_ref: true
ghcr.io/imyousuf/webhook-broker:${{ steps.get_version.outputs.VERSION }}
helm_chart:
name: Helm Chart Release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ As part of the Terraform configuration, we deploy Webhook Broker using a [Helm C
Our docker images are host in 2 repositories -

1. [Docker Hub](https://hub.docker.com/repository/docker/imyousuf/webhook-broker)
2. [Github Docker Registry](https://github.com/imyousuf/webhook-broker/packages)
2. [Github Docker Registry](https://github.com/users/imyousuf/packages/container/package/webhook-broker)

The difference being Docker Hub will have images for builds from `main` branch whenever a commit is pushed to the branch. Whereas Github registry will only contain releases. The distinction is made so that docker hub can be used for continuous deployment whereas Github Docker Registry for stable releases. The docker [compose file](https://github.com/imyousuf/webhook-broker/blob/main/docker-compose.integration-test.yaml) for integration test gives a good idea how about to setup an environment using docker images and how to configure it through volume mount.

Expand Down

0 comments on commit 4c9b84b

Please sign in to comment.