From 80fc27210d0c60391b97c548ea1ef5065abeaf1e Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Mon, 10 Jun 2024 11:03:06 +0200 Subject: [PATCH] Also push container to Docker Hub This change will require some secrets to be added before merging. I'll update when this has been done. --- .github/workflows/docker.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7bf0675d..3e0d6995 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -39,3 +39,23 @@ jobs: tags: | ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ github.ref_name }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + if: github.repository_owner == 'gridscale' + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Push to Docker Hub + uses: docker/build-push-action@v5 + if: github.repository_owner == 'gridscale' + with: + context: . + push: true + labels: | + git_commit=${{ github.sha }} + version=${{ github.ref_name }} + tags: | + ${{ github.repository }}:latest + ${{ github.repository }}:${{ github.ref_name }}