1
- name : Build & Push container to GH registry
1
+ name : Build & Push
2
2
3
3
on :
4
4
push :
@@ -12,32 +12,8 @@ permissions:
12
12
contents : write
13
13
14
14
jobs :
15
- modified-dockerfiles :
16
- name : Have any Dockerfiles been modified?
17
- runs-on : ubuntu-latest
18
- steps :
19
- -
20
- name : Checkout source
21
- uses : actions/checkout@v3
22
-
23
- -
24
- name : Check if any Dockerfiles were modified
25
- uses : dorny/paths-filter@v2
26
- id : changes
27
- with :
28
- filters : |
29
- cpu:
30
- - 'cpu/Dockerfile'
31
- hashcat:
32
- - 'hashcat/Dockerfile'
33
- nvidia:
34
- - 'nvidia/Dockerfile'
35
- wordlists:
36
- - 'wordlists/Dockerfile'
37
-
38
15
build-dependencies :
39
- name : Build dependencies required for core files
40
- needs : [ modified-dockerfiles ]
16
+ name : Dependencies
41
17
strategy :
42
18
fail-fast : true
43
19
matrix :
@@ -46,38 +22,22 @@ jobs:
46
22
steps :
47
23
-
48
24
name : Checkout source
49
- uses : actions/checkout@v3
25
+ uses : actions/checkout@v4
50
26
51
27
-
52
- name : Login to ghcr.io
53
- uses : docker/login-action@v2
54
- with :
55
- registry : ghcr.io
56
- username : yimura
57
- password : ${{ secrets.PACKAGE_WRITE_TOKEN }}
58
-
59
- -
60
- name : Build and push container
61
- if : steps.changes.outputs.${{ matrix.image }} == 'true'
62
- uses : docker/build-push-action@v4
63
- with :
64
- file : ${{ matrix.image }}/Dockerfile
65
- push : true
66
- tags : ghcr.io/yimura/crackerjack-docker:${{ matrix.image }}
67
- build-args : |
68
- ADD_WORDLIST_N_RULES=true
28
+ name : Set up Docker Buildx
29
+ uses : docker/setup-buildx-action@v3
69
30
70
31
-
71
32
name : Login to Docker Hub
72
- uses : docker/login-action@v2
33
+ uses : docker/login-action@v3
73
34
with :
74
35
username : yimura
75
36
password : ${{ secrets.DOCKER_TOKEN }}
76
37
77
38
-
78
- name : Build and push container
79
- if : steps.changes.outputs.${{ matrix.image }} == 'true'
80
- uses : docker/build-push-action@v4
39
+ name : Build dependency
40
+ uses : docker/build-push-action@v5
81
41
with :
82
42
file : ${{ matrix.image }}/Dockerfile
83
43
push : true
86
46
ADD_WORDLIST_N_RULES=true
87
47
88
48
build-container :
89
- name : Building CPU and GPU images
49
+ name : CPU & GPU
90
50
needs : [ build-dependencies ]
91
51
strategy :
92
52
fail-fast : true
@@ -96,37 +56,36 @@ jobs:
96
56
steps :
97
57
-
98
58
name : Checkout source
99
- uses : actions/checkout@v3
59
+ uses : actions/checkout@v4
60
+
61
+ -
62
+ name : Set up Docker Buildx
63
+ uses : docker/setup-buildx-action@v3
100
64
101
65
-
102
66
name : Login to ghcr.io
103
- uses : docker/login-action@v2
67
+ uses : docker/login-action@v3
104
68
with :
105
69
registry : ghcr.io
106
70
username : yimura
107
71
password : ${{ secrets.PACKAGE_WRITE_TOKEN }}
108
72
109
- -
110
- name : Build and push container
111
- if : steps.changes.outputs.${{ matrix.image }} == 'true'
112
- uses : docker/build-push-action@v4
113
- with :
114
- file : ${{ matrix.image }}/Dockerfile
115
- push : true
116
- tags : ghcr.io/yimura/crackerjack-docker:${{ matrix.image }}
117
-
118
73
-
119
74
name : Login to Docker Hub
120
- uses : docker/login-action@v2
75
+ uses : docker/login-action@v3
121
76
with :
122
77
username : yimura
123
78
password : ${{ secrets.DOCKER_TOKEN }}
124
79
125
80
-
126
- name : Build and push container
127
- if : steps.changes.outputs.${{ matrix.image }} == 'true'
128
- uses : docker/build-push-action@v4
81
+ name : Build and push to Docker Hub
82
+ uses : docker/build-push-action@v5
129
83
with :
130
84
file : ${{ matrix.image }}/Dockerfile
131
85
push : true
132
86
tags : yimura/crackerjack-docker:${{ matrix.image }}
87
+
88
+ -
89
+ name : Retag and push to Github Container Registry
90
+ run : |
91
+ docker buildx imagetools create --tag ghcr.io/yimura/crackerjack-docker:${{ matrix.image }} yimura/crackerjack-docker:${{ matrix.image }}
0 commit comments