Skip to content

Commit

Permalink
dummy: fixed extracting from docker
Browse files Browse the repository at this point in the history
  • Loading branch information
sitole committed Dec 19, 2023
1 parent 6827a21 commit 24257df
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 24257df

Please sign in to comment.