Skip to content

Commit

Permalink
Handle permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Oct 20, 2024
1 parent a9e5ed9 commit 14f17a5
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/mirror-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 14f17a5

Please sign in to comment.