Sleep command runs forever

I’m trying to access my local machine via openfortivpn client to run some deploy scripts.

The problem is: after I run the command to connect to VPN, I need to use the “sleep” command to wait for connection. The sleep command runs forever. It happens only when I set the openfortivpn command to run in the background.

name: Deploy

    branches: [ master ]

    runs-on: ubuntu-latest
      - uses: actions/checkout@v2

      - name: Install
        run: |
          sudo apt-get update
          sudo apt-get install openfortivpn -y
          sudo apt-get install ppp

      - name: Run
        continue-on-error: true
        run: |
          sudo openfortivpn ... &

      - name: Wait VPN connection
        run: |
          sleep 30
          # This step runs forever

      - name: ...