-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (40 loc) · 1.05 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: CI
on: push
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
jobs:
app-test:
name: Run Application Tests
runs-on: ubuntu-20.04
env:
MIX_ENV: test
services:
db:
image: postgres
ports: ["5432:5432"]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTRGES_DB: launch_cart_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Setup App
uses: ./.github/workflows/setup
- name: Run Application Tests
uses: ./.github/workflows/app_test
deploy:
needs: app-test
if: github.ref == 'refs/heads/main'
name: Deploy to Fly.IO
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only
- run: flyctl deploy -c launch-cart-dev.toml --remote-only