diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a82e67cd..71a1b9ae 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -9,7 +9,8 @@ on: env: # github.repository as / - IMAGE_NAME: martialbe/one-api + DOCKER_HUB_USERNAME: martialbe + DOCKER_HUB_REPO: one-api jobs: build-and-push: @@ -33,15 +34,24 @@ jobs: uses: docker/login-action@v2 with: registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GT_Token }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + registry: docker.io + username: ${{ env.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} # Replace with your Docker Hub password secret - name: Docker meta id: meta uses: docker/metadata-action@v4 with: # list of Docker images to use as base name for tags - images: ghcr.io/${{ env.IMAGE_NAME }} + images: | + ghcr.io/${{ github.repository }} + docker.io/${{ env.DOCKER_HUB_USERNAME }}/${{ env.DOCKER_HUB_REPO }} # generate Docker tags based on the following events/attributes tags: | type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }}