From e3c861f5b6cb762d3d99f6d6e6dd78cdffe109b6 Mon Sep 17 00:00:00 2001 From: Jia Yuan Lo Date: Wed, 17 Jan 2024 10:50:58 +0800 Subject: [PATCH] enhance(ci): generate, export, store tar archive (#61) --- .github/workflows/docker_build.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index e10cffd..b1b1f19 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -2,6 +2,8 @@ name: Build and push Docker image on: push: + branches: + - master pull_request: schedule: - cron: '0 2 * * 0' @@ -60,3 +62,23 @@ jobs: docker tag termux/termux-docker:i686 termux/termux-docker:latest docker push termux/termux-docker:latest fi + + - name: Export container as tar archive + if: always() + run: | + docker run \ + --privileged \ + --name termux-docker-${{ matrix.CPU_ARCH }} \ + termux/termux-docker:${{ matrix.CPU_ARCH }} \ + uname -a + docker stop termux-docker-${{ matrix.CPU_ARCH }} + docker export -o termux-docker-${{ matrix.CPU_ARCH }}.tar \ + termux-docker-${{ matrix.CPU_ARCH }} + sha256sum termux-docker-${{ matrix.CPU_ARCH }}.tar + + - name: Store tar archive + if: always() + uses: actions/upload-artifact@v4 + with: + name: termux-docker-${{ matrix.CPU_ARCH }}-${{ github.sha }} + path: termux-docker-${{ matrix.CPU_ARCH }}.tar