From 24257df375358795ef1852a3b438fef54bdfd2ae Mon Sep 17 00:00:00 2001 From: Jiri Sveceny Date: Tue, 19 Dec 2023 14:53:52 +0100 Subject: [PATCH] dummy: fixed extracting from docker --- .github/workflows/build.yml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b7ba6e..c77c3a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,34 +21,29 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Build, tag, and push image + - name: Build and tag image run: | docker buildx build \ --platform linux/${{ matrix.platform }} \ --file Dockerfile \ --build-arg IMAGE=nginx:${{ matrix.nginx_version }} \ --tag modules:${{ matrix.nginx_version }}-${{ matrix.platform }} \ - --tag modules:latest-${{ matrix.nginx_version }}-${{ matrix.platform }} \ . - - name: Save Docker image to file - run: | - IMAGE_TAG=${{ github.sha }} - docker save -o saved-module-image.tar your-username/your-repo:${{ matrix.nginx_version }}-${{ matrix.platform }}-$IMAGE_TAG + - name: Run temp container + run: docker run --name temp-container -d modules:${{ matrix.nginx_version }}-${{ matrix.platform }} - - name: Extract file from saved image - run: | - mkdir extracted - tar xf saved-module-image.tar -C extracted + - name: Extract module from container + run: docker cp temp-container:/usr/lib/nginx/modules/otel_ngx_module.so otel_ngx_module.so - - name: Compress extracted file + - name: Compress extracted module run: | - tar czf otel_ngx_module_${{ matrix.nginx_version }}_${{ matrix.platform }}.tgz -C extracted/usr/lib/nginx/modules otel_ngx_module.so + tar -cvf otel_ngx_module_${{ matrix.nginx_version }}_${{ matrix.platform }}.tgz otel_ngx_module.so - name: Upload extracted file uses: actions/upload-artifact@v2 with: - name: otel-ngx-module-${{ matrix.nginx_version }}-${{ matrix.platform }}.tgz + name: otel_ngx_module_${{ matrix.nginx_version }}_${{ matrix.platform }}.tgz path: otel_ngx_module_${{ matrix.nginx_version }}_${{ matrix.platform }}.tgz - name: Upload extracted file as release artifact asset @@ -57,4 +52,4 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} release-tag: ${{ github.ref_name }} - file-path: otel-ngx-module-${{ matrix.nginx_version }}-${{ matrix.platform }}.tgz + file-path: otel_ngx_module_${{ matrix.nginx_version }}_${{ matrix.platform }}.tgz