File tree Expand file tree Collapse file tree 2 files changed +57
-17
lines changed Expand file tree Collapse file tree 2 files changed +57
-17
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,9 @@ version: 2.1
3
3
orbs :
4
4
browser-tools :
circleci/[email protected]
5
5
6
- docker :
circleci/[email protected]
7
6
8
7
jobs :
9
- run-tests :
8
+ build :
10
9
parallelism : 1
11
10
docker :
12
11
- image : cimg/ruby:3.2.2-browsers
@@ -108,18 +107,3 @@ jobs:
108
107
name : Run system tests
109
108
command : |
110
109
COVERAGE=false bundle exec rspec spec/system/
111
-
112
- workflows :
113
- test-build-and-publish-image :
114
- jobs :
115
- - run-tests
116
- - docker/publish :
117
- cache_from : stringerrss/stringer:latest
118
- image : stringerrss/stringer
119
- tag : latest,$CIRCLE_SHA1
120
- update-description : false
121
- requires :
122
- - run-tests
123
- filters :
124
- branches :
125
- only : main
Original file line number Diff line number Diff line change
1
+ name : Build Docker image and push to Dockerhub
2
+
3
+ on :
4
+ push
5
+ env :
6
+ IMAGE_NAME : stringerrss/stringer
7
+
8
+ jobs :
9
+ buildx :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v3
14
+
15
+ - name : Set up QEMU
16
+ uses : docker/setup-qemu-action@v2
17
+
18
+ - name : Set up Docker Buildx
19
+ id : buildx
20
+ uses : docker/setup-buildx-action@v2
21
+
22
+ - name : Extract Docker sha tag
23
+ id : get-tag-sha
24
+ uses : docker/metadata-action@v4
25
+ with :
26
+ images : ${{ env.IMAGE_NAME }}
27
+ tags : type=sha
28
+
29
+ - name : Extract Docker latest tag
30
+ id : get-tag-latest
31
+ uses : docker/metadata-action@v4
32
+ with :
33
+ images : ${{ env.IMAGE_NAME }}
34
+ tags : type=raw, value=latest
35
+
36
+ - name : Log in to Docker Hub
37
+ if : ${{ github.ref_name == 'main' }}
38
+ id : login
39
+ uses : docker/login-action@v2
40
+ with :
41
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
42
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
43
+
44
+ - name : Build and Push
45
+ id : build-and-push
46
+ uses : docker/build-push-action@v3
47
+ with :
48
+ context : .
49
+ file : ./Dockerfile
50
+ platforms : linux/amd64,linux/arm64
51
+ push : ${{ github.ref_name == 'main' }}
52
+ tags : |
53
+ ${{ steps.get-tag-latest.outputs.tags }}
54
+ ${{ steps.get-tag-sha.outputs.tags }}
55
+ cache-from : type=gha
56
+ cache-to : type=gha
You can’t perform that action at this time.
0 commit comments