diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98f036d..195dd02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,10 @@ jobs: exit 1 fi + - name: Clean up containers + run: | + docker ps -aq | xargs docker rm -f + native-build: name: Native Linux Build needs: detect-project @@ -84,6 +88,10 @@ jobs: name: linux-binary path: ${{ needs.detect-project.outputs.project-dir }}/target/x86_64-unknown-linux-gnu/release/${{ needs.detect-project.outputs.project-name }} + - name: Clean up containers + run: | + docker ps -aq | xargs docker rm -f + windows-cross: name: Windows Cross-Compile needs: detect-project @@ -121,6 +129,10 @@ jobs: name: windows-binary path: ${{ needs.detect-project.outputs.project-dir }}/target/x86_64-pc-windows-gnu/release/${{ needs.detect-project.outputs.project-name }}.exe + - name: Clean up containers + run: | + docker ps -aq | xargs docker rm -f + docker-build: name: Build Linux Docker Image needs: [native-build, windows-cross, detect-project] @@ -164,13 +176,7 @@ jobs: docker tag ${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} echo "Pushing Linux Docker image to registry: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }}" docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:linux-${{ env.TAG }} - - cleanup: - name: Cleanup - if: always() - needs: [docker-build, native-build, windows-cross] - runs-on: ubuntu-latest - steps: - - name: Cleanup Docker images - if: contains(needs.*.result, 'failure') - run: docker system prune -a -f \ No newline at end of file + + - name: Clean up containers + run: | + docker ps -aq | xargs docker rm -f \ No newline at end of file