Skip to content

broken prod ci pipeline #58

broken prod ci pipeline

broken prod ci pipeline #58

Workflow file for this run

name: Prod in Flight
on:
pull_request:
branches: [ prod ]
jobs:
test:
runs-on: ubuntu-20.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
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
otp: ['26.2']
elixir: ['1.16.3']
steps:
- uses: actions/checkout@v2
- name: Install dependecies for build
run: sudo apt-get install -y libncurses-dev libtinfo5
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- run: mix deps.get
- run: mix test
- 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
working-directory: ./
run: mix deps.get
- name: Run tests
env:
# use localhost for the host here because we are running the job on the VM.
# If we were running the job on in a container this would be postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
working-directory: ./
run: mix test
deploy:
needs: test
name: Build & Deploy to Fly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: superfly/flyctl-actions@master
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_APP: vyasa
with:
args: "deploy"