-
Notifications
You must be signed in to change notification settings - Fork 72
122 lines (120 loc) · 4.12 KB
/
rails_application.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
name: rails_application
on:
push:
pull_request:
types: [ opened, reopened ]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
env:
WORKING_DIRECTORY: rails_application
services:
postgres_11:
image: postgres:11
env:
POSTGRES_DB: cqrs-es-sample-with-res_test
POSTGRES_PASSWORD: secret
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.3.4
bundler-cache: true
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: Assets Precompile
working-directory: ${{ env.WORKING_DIRECTORY }}
run: bundle exec rails tailwindcss:build
- run: make test
working-directory: ${{ env.WORKING_DIRECTORY }}
- uses: 8398a7/action-slack@v3
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW}/${process.env.AS_JOB} ${{ job.status }} in ${process.env.AS_TOOK}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_WEBHOOK }}
if: always()
continue-on-error: true
mutate:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
env:
WORKING_DIRECTORY: rails_application
services:
postgres_11:
image: postgres:11
env:
POSTGRES_DB: cqrs-es-sample-with-res_test
POSTGRES_PASSWORD: secret
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ruby-3.3.4
bundler-cache: true
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: Assets Precompile
working-directory: ${{ env.WORKING_DIRECTORY }}
run: bundle exec rails tailwindcss:build
- run: make mutate
working-directory: ${{ env.WORKING_DIRECTORY }}
- uses: 8398a7/action-slack@v3
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW}/${process.env.AS_JOB} ${{ job.status }} in ${process.env.AS_TOOK}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.CI_WEBHOOK }}
if: always()
continue-on-error: true
release:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
env:
WORKING_DIRECTORY: rails_application
needs: [ test ]
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v3
- uses: akhileshns/[email protected]
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: "res-ecommerce-rails"
heroku_email: "[email protected]"
- uses: 8398a7/action-slack@v3
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
attachments: [{
color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
text: `${process.env.AS_WORKFLOW}/${process.env.AS_JOB} ${{ job.status }} in ${process.env.AS_TOOK}\n${process.env.AS_COMMIT} in ${process.env.AS_REF}`,
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.RELEASE_WEBHOOK }}
if: always()
continue-on-error: true