From 544fd7bab002e11208764b57962ccbecda474f7a Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Fri, 9 Aug 2024 13:14:52 +0200 Subject: [PATCH 1/2] gh: restrict action to MPTCP repo Because secrets need to be set to push on Docker Hub. Signed-off-by: Matthieu Baerts (NGI0) --- .github/workflows/dockerhub.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index d8fde45..684f974 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -8,6 +8,7 @@ on: jobs: docker: + if: github.repository_owner == 'multipath-tcp' runs-on: ubuntu-latest steps: - From 0563c6f0a9e88bd2df8b3c17fdf61d89c930b344 Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Fri, 9 Aug 2024 13:17:02 +0200 Subject: [PATCH 2/2] gh: publish image on ghcr.io It looks like the Docker Hub and its mirrors are no longer available in China, while ghrc.io seems OK for the moment. It is easy to publish the image on ghcr.io as well, let's do that then. Signed-off-by: Matthieu Baerts (NGI0) --- .github/workflows/dockerhub.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 684f974..46a0731 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -8,8 +8,14 @@ on: jobs: docker: + name: Build and push Docker images to multiple registries if: github.repository_owner == 'multipath-tcp' runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write steps: - name: Set up QEMU @@ -23,12 +29,21 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: platforms: linux/amd64,linux/arm64 push: true - tags: mptcp/mptcp-upstream-virtme-docker:${{ github.ref_name }} + tags: | + mptcp/mptcp-upstream-virtme-docker:${{ github.ref_name }} + ghcr.io/${{ github.repository }}:${{ github.ref_name }}