diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 20b4da2..b4f6c68 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,11 +1,12 @@ -name: Docker Image CI +name: Docker image CI on: push: branches: [ master ] jobs: - docker: + build: + name: Build and push Docker image to Docker Hub and GitHub Containers Repository runs-on: ubuntu-latest steps: - name: Checkout @@ -15,7 +16,9 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: tigerblue77/dell_idrac_fan_controller + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} tags: type=raw,value=latest - name: Login to Docker Hub @@ -23,11 +26,18 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build and push + - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: .