Deploy to Fly.io

To deploy an application that uses an EZSuite library, you need to add the ezsuite repo during the build step.

In your Dockerfile, add the following step before running mix deps.get:

RUN --mount=type=secret,id=ezsuite_auth_key \
    mix hex.repo add ezsuite https://ezsuite.dev/repo \
    --fetch-public-key "SHA256:5WqcbEXE2PRHFpPrlJeaCCS1mAokfq6Bf/rdKzukVQ4" \
    --auth-key "$(cat /run/secrets/ezsuite_auth_key)"

Then, update your fly deploy command like this:

fly deploy --build-secret ezsuite_auth_key="..."

If you want to deploy your application from a CI pipeline like GitHub Actions, make sure to add the auth key as a secret, like this:

- name: Deploy to Fly
  run: fly deploy --build-secret ezsuite_auth_key="${{ secrets.EZSUITE_AUTH_KEY }}"