fly-pr-review-apps: Not able to deploy Phoenix App

I’m trying to use this GithubAction in my Phoenix app.

The problem is in this line https://github.com/superfly/fly-pr-review-apps/blob/5d5f1c2465bf8197d2e64d3266412c380ebf1917/entrypoint.sh#L40

flyctl attempts to execute mix but since mix is not installed in the docker container, it fails.

In addition there are multiple problems with the current main which makes this GithubAction unusable at least for my use case .

I forked the repo and move the main code to index.js, you can find it at https://github.com/slashmili/fly-pr-review-apps/blob/nodejs-action/index.js

I’m using it in my project like:

      - name: Set up Elixir
         uses: erlef/setup-beam@e3f6ffe2878180f57318bf13febd3933ee81f664
         with:
           elixir-version: ${{ env.ELIXIR_VERSION }}
           otp-version: ${{ env.ERLANG_VERSION }}
       - name: Deploy
         id: deploy
         uses: slashmili/fly-pr-review-apps@nodejs-action
         with:
           org: myorg
           region: arn
           postgres: my-staging-db

This way by the time that Deploy step is getting executed, already Elixir and mix is installed can flyctl commands can use the mix command.

If you are interested in maintaining the upstream, I’d purpose that take the same approach. I’m not familiar with node so take my changes with grain of salt.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 28

Commits related to this issue

Most upvoted comments

Thanks for this @type1fool. The problem with not authorized was actually my fly token not having permission, I already solved that. But I really don’t understand how yours - and anyone using 1.2.0 are making this work as I’m always getting exec: "mix": executable file not found in $PATH and if I use 1.0.0 I’m not able to set up secrets. Is there a way to change the arguments of the fly launch command?