Inet_gethost: not found after building mix release on github actions

Hi everyone, I’ve been trying to create an automated deployment flow using github actions where I build on their ubuntu 20.04 runner and rsync the built release folders to a digital ocean ubuntu 20.04 droplet.

The action completes okay, sends the files to the prod server, but I’m getting this error on start:

sh: 1: exec: inet_gethost: not found

I’m guessing that it’s a build target mismatch issue, but I’m not sure why? Has anyone else deployed a raw mix release built with github actions - that is, without deploying it in a docker container? I don’t really want to install erlang, elixir, mix etc. to the production machine and I’d like to not use docker in production if I don’t have to.

Here’s my github action workflow:

name: Elixir Release

on: workflow_dispatch

    runs-on: ${{ matrix.os }}
    name: OTP ${{ matrix.otp }} | Elixir ${{ matrix.elixir }} | Node ${{ matrix.node }} | OS ${{ matrix.os }}
        os: [ubuntu-20.04]
        otp: ['23.1']
        elixir: ['1.11.1']
        node: [12.x]

      #  image: postgres:11
      #  ports: ['5432:5432']
      #  env:
      #    POSTGRES_PASSWORD: postgres
      #  options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

      - uses: actions/checkout@v1.0.0
      - uses: erlef/setup-elixir@v1
          otp-version: ${{ matrix.otp }}
          elixir-version: ${{ matrix.elixir }}
      - uses: actions/setup-node@v1
          node-version: ${{ matrix.node }}

      - name: cache-deps
        id: cache-deps
        uses: actions/cache@v2
          path: deps
          key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
          restore-keys: |
            ${{ runner.os }}-${{ matrix.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-mix-

      - name: cache-build
        id: cache-build
        uses: actions/cache@v2
          path: _build
          key: ${{ runner.os }}-${{ matrix.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-mix-build
          restore-keys: |
            ${{ runner.os }}-${{ matrix.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-mix-

      - name: Install mix dependencies
        if: steps.cache-deps.outputs.cache-hit != 'true'
        run: |
          mix local.rebar --force
          mix local.hex --force
          mix deps.get

      - name: Install js assets
        run: yarn --cwd assets install

      - name: Prepare release
        run: |
          mix compile
          yarn --cwd assets deploy
          mix phx.digest
          mix release
          MIX_ENV: prod

      - name: Get datetime
        run: echo "now=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV

      - name: Deploy to Prod server
        uses: easingthemes/ssh-deploy@v2.1.5
          SSH_PRIVATE_KEY: ${{ secrets.PROD_SECRET_KEY }}
          ARGS: "-rltgoDzvO"
          SOURCE: "./_build/prod/rel/myapp"
          REMOTE_HOST: ${{ secrets.PROD_SSH_HOST }}
          REMOTE_USER: ${{ secrets.PROD_SSH_USER }}
          TARGET: ~/releases/${{ }}