diff --git a/.github/workflows/docker-image-and-run.yml b/.github/workflows/docker-image-and-run.yml new file mode 100644 index 0000000..9722a5f --- /dev/null +++ b/.github/workflows/docker-image-and-run.yml @@ -0,0 +1,38 @@ +name: Docker Image CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:latest + + - name: Create a container and extract the binary + run: | + # Create a container + docker create --name extract-container my-image-name:latest + + # Copy the binary from the container + mkdir -p ./output + docker cp extract-container:/root/Mergen/build/lifter ./output/lifter + + ./output/lifter + + # Remove the container + docker rm extract-container + + - name: Upload the extracted binary as an artifact + uses: actions/upload-artifact@v4 + with: + name: Lifter + path: ./output/lifter