From 196a1e33941e7325974b6f455ad75a45ebe948da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=88=9E?= Date: Fri, 17 Mar 2023 00:11:03 +0800 Subject: [PATCH] ci: adjust ci for Recordermoe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add a new required input `DOCKERHUB_ORGANIZATION_NAME` in reusable Docker workflow. - Remove the `QUAY_USERNAME` and `QUAY_TOKEN` as required inputs. - Update the Docker images to exclude images from `quay.io` and include images from the new `DOCKERHUB_ORGANIZATION_NAME`. - Remove the step for logging in to Quay Container Registry. - Removed cache settings related to `ghcr.io` in the 'Build and push' step. - Add `DOCKERHUB_ORGANIZATION_NAME` parameter in docker build step in `docker_publish.yml`, removing `QUAY_USERNAME` and `QUAY_TOKEN` parameters. Signed-off-by: 陳鈞 --- .../workflows/docker-reused-steps/action.yml | 18 +++--------------- .github/workflows/docker_publish.yml | 3 +-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker-reused-steps/action.yml b/.github/workflows/docker-reused-steps/action.yml index 83620d7..079de05 100644 --- a/.github/workflows/docker-reused-steps/action.yml +++ b/.github/workflows/docker-reused-steps/action.yml @@ -3,14 +3,12 @@ name: Reusable docker workflow description: Reusable docker workflow. inputs: + DOCKERHUB_ORGANIZATION_NAME: + required: true DOCKERHUB_USERNAME: required: true DOCKERHUB_TOKEN: required: true - QUAY_USERNAME: - required: true - QUAY_TOKEN: - required: true tag: required: true @@ -21,7 +19,7 @@ runs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ inputs.DOCKERHUB_USERNAME }}/twitcasting-recorder,ghcr.io/${{ github.repository_owner }}/twitcasting-recorder,quay.io/${{ github.repository_owner }}/twitcasting-recorder + images: ${{ inputs.DOCKERHUB_ORGANIZATION_NAME }}/twitcasting-recorder,ghcr.io/${{ github.repository_owner }}/twitcasting-recorder tags: | ${{ inputs.tag }} latest @@ -50,13 +48,6 @@ runs: username: ${{ github.repository_owner }} password: ${{ github.token }} - - name: Login to Quay Container Registry - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ inputs.QUAY_USERNAME }} - password: ${{ inputs.QUAY_TOKEN }} - - name: Build and push uses: docker/build-push-action@v5 with: @@ -70,8 +61,5 @@ runs: VERSION=${{ inputs.tag }} RELEASE=${{ github.run_number }} platforms: linux/amd64,linux/arm64 - # Cache to regietry instead of gha to avoid the capacity limit. - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/twitcasting-recorder:cache - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/twitcasting-recorder:cache,mode=max sbom: true provenance: true diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index e51dcb4..29d0f19 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -34,8 +34,7 @@ jobs: - name: Build docker uses: ./.github/workflows/docker-reused-steps with: + DOCKERHUB_ORGANIZATION_NAME : ${{ secrets.DOCKERHUB_ORGANIZATION_NAME }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} - QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }} tag: ${{ github.ref_name }}