diff --git a/.github/workflows/Backend-CD-Prod-A.yml b/.github/workflows/Backend-CD-Prod-A.yml index 1e43ca0b..6e0ff3bb 100644 --- a/.github/workflows/Backend-CD-Prod-A.yml +++ b/.github/workflows/Backend-CD-Prod-A.yml @@ -33,6 +33,8 @@ jobs: echo "No container named 'server' to remove." fi + sudo docker system prune -f + docker pull ${{ secrets.DOCKER_SERVER_IMAGE }} docker run -d -p 80:8080 --name server \ diff --git a/.github/workflows/Backend-CD-Prod-B.yml b/.github/workflows/Backend-CD-Prod-B.yml index 24e924fb..9265fe79 100644 --- a/.github/workflows/Backend-CD-Prod-B.yml +++ b/.github/workflows/Backend-CD-Prod-B.yml @@ -16,6 +16,7 @@ jobs: - name: Port forwarding begin run: | + sudo sysctl -w net.ipv4.ip_forward=1 sudo iptables -t nat -I PREROUTING 1 -p tcp --dport 80 -j DNAT --to-destination ${{ secrets.BE_PROD_A_PRIVATE_IP }}:80 sudo iptables -t nat -I POSTROUTING 1 -p tcp --dport 80 -j SNAT --to-source ${{ secrets.BE_PROD_B_PRIVATE_IP }} sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT @@ -32,6 +33,8 @@ jobs: echo "No container named 'server' to remove." fi + sudo docker system prune -f + docker pull ${{ secrets.DOCKER_SERVER_IMAGE }} docker run -d -p 80:8080 --name server \