From 4c9b84b2cc627fffbe26784bad2bfafbf7f67f3e Mon Sep 17 00:00:00 2001 From: Imran M Yousuf Date: Mon, 25 Jan 2021 11:16:54 -0500 Subject: [PATCH] Refactor release CI process to use new Github Docker Registry 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 --- .github/workflows/release.yml | 21 +++++++++++---------- README.md | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 035277e..495ca4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/README.md b/README.md index 9b1dbe2..956ec64 100644 --- a/README.md +++ b/README.md @@ -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.