-
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (131 loc) · 4.39 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
# This action is triggered on any branch that opens a pull request.
push:
branches:
- "*"
# This action is not triggered when markdown files are modified.
paths-ignore:
- '**.md'
# This action is triggered on any branch that opens a pull request.
pull_request:
branches:
- "*"
# This action is not triggered when markdown files are modified.
paths-ignore:
- '**.md'
env:
# Permissions env
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# General env
MIX_ENV: test
ELIXIR_VERSION: 1.14
OTP_VERSION: 25.2
# Cloudinary env
CLOUDEX_API_KEY: ${{ secrets.CLOUDEX_API_KEY }}
CLOUDEX_CLOUD_NAME: ${{ secrets.CLOUDEX_CLOUD_NAME }}
CLOUDEX_SECRET: ${{ secrets.CLOUDEX_SECRET }}
# Captcha
RECAPTCHA_PUBLIC_KEY: ${{ secrets.RECAPTCHA_PUBLIC_KEY }}
RECAPTCHA_SECRET: ${{ secrets.RECAPTCHA_SECRET }}
# Postgres env
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
POSTGRES_HOSTNAME: localhost
# Misc env
UPLOADS_PATH: "priv/static/uploads/"
jobs:
dev:
runs-on: ubuntu-20.04
services:
db:
image: postgres
ports: ['5432:5432']
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2.3.4
- name: Run Development Checks
uses: ./.github/actions/dev
with:
CLOUDEX_API_KEY: ${{ env.CLOUDEX_API_KEY }}
CLOUDEX_CLOUD_NAME: ${{ env.CLOUDEX_CLOUD_NAME }}
CLOUDEX_SECRET: ${{ env.CLOUDEX_SECRET }}
ELIXIR_VERSION: ${{ env.ELIXIR_VERSION }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
MIX_ENV: dev
OTP_VERSION: ${{ env.OTP_VERSION }}
RECAPTCHA_PUBLIC_KEY: ${{ env.RECAPTCHA_PUBLIC_KEY }}
RECAPTCHA_SECRET: ${{ env.RECAPTCHA_SECRET }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ env.POSTGRES_USER }}
UPLOADS_PATH: priv/static/uploads/
test:
runs-on: ubuntu-20.04
services:
db:
image: postgres
ports: ['5432:5432']
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2.3.4
- name: Run Unit Tests
uses: ./.github/actions/test
with:
CLOUDEX_API_KEY: ${{ env.CLOUDEX_API_KEY }}
CLOUDEX_CLOUD_NAME: ${{ env.CLOUDEX_CLOUD_NAME }}
CLOUDEX_SECRET: ${{ env.CLOUDEX_SECRET }}
ELIXIR_VERSION: ${{ env.ELIXIR_VERSION }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
MIX_ENV: test
OTP_VERSION: ${{ env.OTP_VERSION }}
RECAPTCHA_PUBLIC_KEY: ${{ env.RECAPTCHA_PUBLIC_KEY }}
RECAPTCHA_SECRET: ${{ env.RECAPTCHA_SECRET }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ env.POSTGRES_USER }}
UPLOADS_PATH: priv/static/uploads/
prod:
runs-on: ubuntu-20.04
services:
db:
image: postgres
ports: ['5432:5432']
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2.3.4
- name: Assemble release
uses: ./.github/actions/prod
with:
CLOUDEX_API_KEY: ${{ env.CLOUDEX_API_KEY }}
CLOUDEX_CLOUD_NAME: ${{ env.CLOUDEX_CLOUD_NAME }}
CLOUDEX_SECRET: ${{ env.CLOUDEX_SECRET }}
ELIXIR_VERSION: ${{ env.ELIXIR_VERSION }}
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
MIX_ENV: prod
OTP_VERSION: ${{ env.OTP_VERSION }}
RECAPTCHA_PUBLIC_KEY: ${{ env.RECAPTCHA_PUBLIC_KEY }}
RECAPTCHA_SECRET: ${{ env.RECAPTCHA_SECRET }}
POSTGRES_HOSTNAME: ${{ env.POSTGRES_HOSTNAME }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_USER: ${{ env.POSTGRES_USER }}
UPLOADS_PATH: priv/static/uploads/