Skip to content

Commit

Permalink
ci: adjust ci for Recordermoe
Browse files Browse the repository at this point in the history
- 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: 陳鈞 <jim60105@gmail.com>
  • Loading branch information
jim60105 committed May 18, 2024
1 parent 8dc466a commit 196a1e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/docker-reused-steps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
3 changes: 1 addition & 2 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 196a1e3

Please sign in to comment.