diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 9b3faf5e..87032bb5 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -45,6 +45,17 @@ jobs: powershell sudo apt-get autoremove + - name: Enable proxy on container + shell: bash + if: ${{ github.event.inputs.type != 'ubuntu-latest' }} + run: | + if ! [[ -z "${HTTP_PROXY}" ]]; then + PROXY_ADDR=http://$(hostname -I | cut -d' ' -f1 | xargs):8118 + echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV + sudo iptables -D INPUT -p tcp -s localhost --dport 8118 -j ACCEPT + sudo iptables -D INPUT -p tcp --dport 8118 -j DROP + fi + - name: Checkout repo uses: actions/checkout@v2 with: