Commit 0c0d208 1 parent 16a1ee8 commit 0c0d208 Copy full SHA for 0c0d208
File tree 2 files changed +56
-5
lines changed
2 files changed +56
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and push Docker image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+
8
+ jobs :
9
+ push :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Login to Quay
16
+ uses : docker/login-action@v3
17
+ with :
18
+ registry : quay.io
19
+ username : ${{ vars.DOCKER_USERNAME }}
20
+ password : ${{ secrets.DOCKER_PASSWORD }}
21
+
22
+ - name : Set up Docker BuildX
23
+ uses : docker/setup-buildx-action@v3
24
+ with :
25
+ version : v0.11.2
26
+
27
+ - name : Restore build cache
28
+ uses : actions/cache@v3
29
+ with :
30
+ path : /tmp/.buildx-${{ github.ref_name }}-cache
31
+ key : ${{ runner.os }}-buildx-${{ github.ref_name }}
32
+ restore-keys : |
33
+ ${{ runner.os }}-buildx-${{ github.ref_name }}
34
+
35
+ - name : Build and push
36
+ run : |
37
+ make push
38
+ env :
39
+ BRANCH_NAME : ${{ github.ref_name }}
40
+ RELEASE_ID : ${{ github.run_number }}
41
+ GIT_HASH : ${{ github.sha }}
Original file line number Diff line number Diff line change
1
+ DOCKER_REPOSITORY ?= quay.io/road
2
+ BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
3
+ GIT_HASH ?= $(shell git rev-parse HEAD)
4
+ RELEASE_ID ?= $(shell id -un) -local
5
+ DOCKER_LATEST_TAG ?= latest
6
+
1
7
build :
2
- DOCKER_BUILDKIT=1 DOCKER_SCAN_SUGGEST=false docker build -t e-flux-tools-mongo-backup:latest -f Dockerfile --platform=linux/amd64 .
3
- docker tag e-flux-tools-mongo-backup:latest europe-west3-docker.pkg.dev/eflux-staging/docker/e-flux-tools-mongo-backup:latest
4
- docker tag e-flux-tools-mongo-backup:latest europe-west3-docker.pkg.dev/eflux-production/docker/e-flux-tools-mongo-backup:latest
8
+ docker buildx build \
9
+ --cache-from type=local,src=/tmp/.buildx-$(BRANCH_NAME ) -mongodb-backups-cache \
10
+ --cache-to type=local,mode=max,dest=/tmp/.buildx-$(BRANCH_NAME ) -mongodb-backups-cache \
11
+ --provenance mode=min,inline-only=true \
12
+ --tag $(DOCKER_REPOSITORY ) /mongodb-backups:$(GIT_HASH ) \
13
+ --tag $(DOCKER_REPOSITORY ) /mongodb-backups:$(DOCKER_LATEST_TAG ) \
14
+ --tag $(DOCKER_REPOSITORY ) /mongodb-backups:release-$(RELEASE_ID ) \
15
+ --push \
16
+ .
5
17
6
18
push : build
7
- docker push europe-west3-docker.pkg.dev/eflux-staging/docker/e-flux-tools-mongo-backup:latest
8
- docker push europe-west3-docker.pkg.dev/eflux-production/docker/e-flux-tools-mongo-backup:latest
You can’t perform that action at this time.
0 commit comments