👷 ci: add dockerHub
This commit is contained in:
parent
bfebf70b99
commit
b663519204
18
.github/workflows/docker-image.yml
vendored
18
.github/workflows/docker-image.yml
vendored
@ -9,7 +9,8 @@ on:
|
||||
|
||||
env:
|
||||
# github.repository as <account>/<repo>
|
||||
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' }}
|
||||
|
Loading…
Reference in New Issue
Block a user