From 14f17a54275d0908393880fc2b299aaab19f33a8 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Sun, 20 Oct 2024 13:04:47 +0200 Subject: [PATCH] Handle permissions --- .github/workflows/mirror-docker-image.yml | 31 ++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mirror-docker-image.yml b/.github/workflows/mirror-docker-image.yml index 4e4ebbec45b..aa49ceb72d6 100644 --- a/.github/workflows/mirror-docker-image.yml +++ b/.github/workflows/mirror-docker-image.yml @@ -15,7 +15,36 @@ on: default: 'true' jobs: - copy-to-docker-hub: + + copy-to-docker-hub-alpha: + if: github.ref_name == 'alpha' + runs-on: ubuntu-latest + environment: + name: alpha + steps: + # Free disk space + - name: Free Disk space + if: github.event.inputs.free-space-before == 'true' + shell: bash + run: | + sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android + sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET + # Login to docker hub + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + # Copy ghrc.io image to Docker Hub + - name: Pull image from GHCR + run: docker pull "${{ github.event.inputs.source-image }}" + - name: Tag image for Docker Hub + run: docker tag "${{ github.event.inputs.source-image }}" "${{ github.event.inputs.target-image }}" + - name: Push image to Docker Hub + run: docker push "${{ github.event.inputs.target-image }}" + + copy-to-docker-hub-main: + if: github.ref_name == 'main' runs-on: ubuntu-latest environment: name: beta