Skip to content

Commit

Permalink
fix action regestry
Browse files Browse the repository at this point in the history
fix action regestry
  • Loading branch information
Two-Play committed Nov 27, 2024
1 parent d0d3517 commit 2a517c8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
# Docker Login
- name: Log in to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -38,27 +38,31 @@ jobs:
- name: Build and tag Docker image
run: |
IMAGE_NAME="twoplay/craftybot"
VERSION=$TAG
VERSION=$tag
LOWERCASE_REPO=$repository
echo "tag=$tag"
echo "Building Docker image $IMAGE_NAME:$VERSION"
# Build Image
docker build -t $IMAGE_NAME:latest -t $IMAGE_NAME:$VERSION .
echo "Tagging Docker image latest"
docker tag $IMAGE_NAME:latest ghcr.io/$LOWERCASE_REPO:latest
echo "Tagging Docker image $VERSION"
docker tag $IMAGE_NAME:$VERSION ghcr.io/$LOWERCASE_REPO:$VERSION
# Push to DockerHub
- name: Push DockerHub image
run: |
IMAGE_NAME="twoplay/craftybot"
VERSION=$TAG
VERSION=$tag
docker push $IMAGE_NAME:latest
docker push $IMAGE_NAME:$VERSION
# Push to GitHub Packages
- name: Push GitHub image
run: |
VERSION=$TAG
VERSION=$tag
LOWERCASE_REPO=$repository
docker push ghcr.io/$LOWERCASE_REPO:latest
Expand Down

0 comments on commit 2a517c8

Please sign in to comment.