diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..f5dffec --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,47 @@ +name: build rootfs + +on: + push: + branches: [ 'master' ] + paths: + - 'build.sh' + - 'Dockerfile' + pull_request: + branches: [ 'master' ] + paths: + - 'build.sh' + - 'Dockerfile' + workflow_dispatch: + +jobs: + build: + name: Build tar file + runs-on: ubuntu-latest + strategy: + matrix: + arch: [ amd64, arm64, riscv64, loong64, i386 ] + + steps: + - name: Read Rootfs version + run: | + echo "ROOTFS_VERSION=$(curl -s https://raw.githubusercontent.com/deepin-community/deepin-rootfs/master/version.txt | cat)" >> $GITHUB_ENV + shell: bash + env: + GITHUB_ENV: ${{ env.GITHUB_ENV }} + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Run build.sh + run: | + sudo bash build.sh "v${{ env.ROOTFS_VERSION }}" ${{ matrix.arch }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Docker image push + run: | + docker push chenchongbiao/deepin:beige-${{ matrix.arch }}-"v${{ env.ROOTFS_VERSION }}" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc6cf83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM scratch + +ARG ROOTFS_URL +ADD $ROOTFS_URL / + +CMD ["bash"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..4d0c068 --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e -u -x + +VERSION=$1 +ARCH=$2 +owner=chenchongbiao +ROOTFS_URL=https://github.com/deepin-community/deepin-rootfs/releases/download/${VERSION}/deepin-rootfs-${ARCH}.tar.gz +docker build --build-arg ROOTFS_URL=$ROOTFS_URL -t ${owner}/deepin:beige-${ARCH}-${VERSION} . + +if [ "${ARCH}" = amd64 ]; then + docker tag ${owner}/deepin:beige-${ARCH}-${VERSION} "${owner}/deepin:beige" +fi \ No newline at end of file