-
Notifications
You must be signed in to change notification settings - Fork 3
160 lines (132 loc) · 4.67 KB
/
build.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Build
on:
push:
branches:
- '**'
concurrency:
cancel-in-progress: true
group: ${{ github.ref }}
jobs:
BuildServer:
strategy:
# Don't fast-fail on tag and master
fail-fast: ${{ github.event_name == 'pull_request' || (github.ref !=
'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) }}
name: Building server image
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops to register image
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
imageName: ${{ env.project }}/server
dockerfile: ./src/server/Dockerfile
dockercontext: ./src
BuildFront:
strategy:
# Don't fast-fail on tag and master
fail-fast: ${{ github.event_name == 'pull_request' || (github.ref !=
'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) }}
name: Building front image
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops to register image
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
imageName: ${{ env.project }}/client
dockerfile: ./src/client/Dockerfile
dockercontext: ./src/client
BuildGraphIql:
strategy:
# Don't fast-fail on tag and master
fail-fast: ${{ github.event_name == 'pull_request' || (github.ref !=
'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) }}
name: Building GraphIQL image
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops to register image
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
imageName: ${{ env.project }}/graphiql
dockerfile: ./src/graphiql/Dockerfile
dockercontext: ./src/graphiql
BuildStrapi:
strategy:
# Don't fast-fail on tag and master
fail-fast: ${{ github.event_name == 'pull_request' || (github.ref !=
'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) }}
name: Building strapi image
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops to register image
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
imageName: ${{ env.project }}/strapi
dockerfile: ./src/strapi/Dockerfile
dockercontext: ./src/strapi
BuildN8N:
strategy:
# Don't fast-fail on tag and master
fail-fast: ${{ github.event_name == 'pull_request' || (github.ref !=
'refs/heads/master' && !startsWith(github.ref, 'refs/tags/')) }}
name: Building N8N image
runs-on: ubuntu-latest
steps:
- name: Get project name
run: |
echo "project=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Use autodevops to register image
uses: SocialGouv/actions/autodevops-build-register@v1
with:
environment: dev
token: ${{ secrets.GITHUB_TOKEN }}
imageName: ${{ env.project }}/n8n
dockerfile: ./src/n8n/Dockerfile
dockercontext: ./src/n8n
Manifests:
name: Generate k8s manifests for server
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Load review environment variables
run: |
cat ".github/dev.env" >> $GITHUB_ENV
- uses: SocialGouv/actions/autodevops-manifests@v1
with:
environment: dev
rancherId: ${{ env.RANCHER_PROJECT_ID }}
socialgouvBaseDomain: ${{ env.SOCIALGOUV_BASE_DOMAIN }}
deploy:
name: Deploy application
runs-on: ubuntu-latest
needs: [ BuildServer, BuildFront, BuildStrapi, BuildN8N, BuildGraphIql, Manifests ]
steps:
- uses: actions/checkout@v2
- name: Load environment variables
run: cat ".github/dev.env" >> $GITHUB_ENV
- uses: SocialGouv/actions/autodevops-deploy@v1
with:
environment: "dev"
token: ${{ secrets.GITHUB_TOKEN }}
kubeconfig: ${{ secrets.KUBECONFIG }}
rancherId: ${{ env.RANCHER_PROJECT_ID }}