5
5
branches : [main]
6
6
7
7
jobs :
8
- prepare :
8
+ build-and-deploy-frontend :
9
9
runs-on : ubuntu-latest
10
- outputs :
11
- code : ${{ steps.checkout.outputs.sha }}
10
+
12
11
steps :
13
12
- name : Checkout code
14
- id : checkout
15
13
uses : actions/checkout@v2
16
14
17
15
- name : Login to GitHub Container Registry
21
19
username : ${{ github.actor }}
22
20
password : ${{ secrets.GITHUB_TOKEN }}
23
21
24
- build-and-push-frontend :
25
- runs-on : ubuntu-latest
26
- needs : prepare
27
- steps :
28
- - name : Docker meta for frontend
22
+ - name : Docker meta
29
23
id : meta-frontend
30
24
uses : docker/metadata-action@v4
31
25
with :
@@ -40,14 +34,23 @@ jobs:
40
34
push : true
41
35
tags : ${{ steps.meta-frontend.outputs.tags }}
42
36
43
- build-and-push-backend :
37
+
38
+ build-and-deploy-backend :
44
39
runs-on : ubuntu-latest
45
- needs : prepare
40
+ needs : build-and-deploy-frontend
41
+
46
42
steps :
47
- - name : Use prepared code
48
- run : echo "Using code checked out in the prepare stage"
43
+ - name : Checkout code
44
+ uses : actions/checkout@v2
49
45
50
- - name : Docker meta for backend
46
+ - name : Login to GitHub Container Registry
47
+ uses : docker/login-action@v3
48
+ with :
49
+ registry : ghcr.io
50
+ username : ${{ github.actor }}
51
+ password : ${{ secrets.GITHUB_TOKEN }}
52
+
53
+ - name : Docker meta
51
54
id : meta-backend
52
55
uses : docker/metadata-action@v4
53
56
with :
60
63
context : .
61
64
file : ./backend/Dockerfile
62
65
push : true
63
- tags : ${{ steps.meta-backend.outputs.tags }}
64
-
66
+ tags : ${{ steps.meta-backend.outputs.tags }}
0 commit comments