📎 Webclip
Deploy on Ubuntu with mix release and Github Actions (without Docker)
The post describes a lightweight deployment setup for an Elixir/Phoenix application on an Ubuntu server. After installing Elixir and mix on the server, deployment becomes a sequence of pull, release, migrate, and restart steps.
Reading notes#
- mix release is presented as a way to build self-contained releases for an Elixir project.
- A DigitalOcean Ubuntu server is used as the target deployment environment.
- The server-side script loads environment variables from ~/.profile when available.
- The script uses set -e so deployment stops if any command fails.
- The project directory is entered, and git stash is used before git pull origin master.
- mix deps.get and mix phx.digest are run through an asdf mix binary path.
- mix release –overwrite is run with MIX_ENV=prod.
- After the release, the script runs database migrations through the release binary.
- The application is restarted through the release binary.
- A GitHub Actions workflow triggers on pushes to master.
- The workflow uses an SSH action to run the deploy script on the server.
- Secrets passed to the action include SSH key material, signing salt, secret key base, port, and MIX_ENV.
- The author says this setup avoids the need for CI, Kubernetes, or complex configuration.
