Skip to content

Attempt update to prod flow to have manual trigger #129

Attempt update to prod flow to have manual trigger

Attempt update to prod flow to have manual trigger #129

Workflow file for this run

name: Prod in Flight
on:
pull_request:
branches: [prod]
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
test:
runs-on: ubuntu-22.04
name: Build OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }} && Run Mix Test
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: root
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
otp: ["26.2"]
elixir: ["1.16.3"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies for build
run: sudo apt-get update && sudo apt-get install -y libncurses-dev libtinfo5
- name: Setup Elixir and OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Restore dependencies cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Run tests
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
run: mix test
deploy:
needs: test
name: Build & Deploy to Fly
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy to Fly.io
uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_APP: vyasa
with:
args: "deploy"