diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 188727d6..f32c2333 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,7 +123,9 @@ jobs: id: meta uses: docker/metadata-action@v5 with: - images: ${{ github.repository }} + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} tags: | type=ref,event=branch type=semver,pattern={{version}},enable=false @@ -142,6 +144,14 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push uses: docker/build-push-action@v5 with: @@ -168,7 +178,9 @@ jobs: id: meta-hw uses: docker/metadata-action@v5 with: - images: ${{ github.repository }} + images: | + ${{ github.repository }} + ghcr.io/${{ github.repository }} flavor: | suffix=-hardware,onlatest=true latest=auto @@ -189,6 +201,14 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v5