-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.45 KB
/
deploy.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
46
47
48
49
50
51
52
53
54
55
56
name: Deploy
on:
pull_request:
branches:
- '*'
push:
branches:
- master
jobs:
FlyioDeploy:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.2
ports:
- 5432/tcp
env:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "testing"
POSTGRES_DATABASE: "transientbug_test"
redis:
image: redis:6.2.6
ports:
- 6379/tcp
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
cache-version: 1
- name: Setup Database
env:
DATABASE_URL: postgresql://postgres:testing@localhost:${{ job.services.postgres.ports['5432'] }}/transientbug_test
REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }}/0
run: ./bin/rails db:prepare
- name: Build API docs
env:
DATABASE_URL: postgresql://postgres:testing@localhost:${{ job.services.postgres.ports['5432'] }}/transientbug_test
REDIS_URL: redis://localhost:${{ job.services.redis.ports['6379'] }}/0
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: ./bin/rails docs:generate
- name: Deploy to fly.io
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
run: ./script/deploy