From 6479c978a1db47eaea9f554b738a52830635cfb2 Mon Sep 17 00:00:00 2001 From: Peng Tao Date: Wed, 5 Jan 2022 14:38:55 +0800 Subject: [PATCH] workflow: add workflow to convert top docker hub images So that we can use them in CI and ref to users to test with. Signed-off-by: Peng Tao --- .github/workflows/convert.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/convert.yml diff --git a/.github/workflows/convert.yml b/.github/workflows/convert.yml new file mode 100644 index 00000000000..482c6d2778a --- /dev/null +++ b/.github/workflows/convert.yml @@ -0,0 +1,41 @@ +name: Convert Top Docker Hub Images + +on: + push: + branches: ["*"] + +env: + CARGO_TERM_COLOR: always + REGISTRY: ghcr.io + #MAGE_NAME: ${{ github.repository }} + ORGANIZATION: ${{ github.repository }} + #ORGANIZATION: nydus-cloudnative + +jobs: + convert-images: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Install Nydus Binaries + run: | + wget https://github.com/dragonflyoss/image-service/releases/download/v1.1.1/nydus-static-v1.1.1-x86_64.tgz + tar xzf nydus-static-v1.1.1-x86_64.tgz + sudo cp nydus-static/nydusify nydus-static/nydus-image /usr/local/bin/ + - name: Log in to the container registry + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Convert Images + run: | + cat ~/.docker/config.json + docker pull ubuntu:latest + docker tag ubuntu:latest ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/ubuntu:latest + echo docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/ubuntu:latest + docker push ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/ubuntu:latest + echo sudo nydusify convert --source ubuntu:latest --target ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/ubuntu:nydus-latest + sudo nydusify convert --source ubuntu:latest --target ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/ubuntu:nydus-latest + +