1
+ name : Docker Build images on Tag
2
+
3
+ on :
4
+ release :
5
+ types : [published]
6
+
7
+ jobs :
8
+ build :
9
+
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - uses : actions/checkout@v2
14
+
15
+ - name : Set up gcloud CLI
16
+ uses :
google-github-actions/[email protected]
17
+ with :
18
+ service_account_key : ${{ secrets.GCP_SA_KEY }}
19
+ project_id : genuine-flight-317411
20
+ export_default_credentials : true
21
+
22
+ # Configure Docker to use the gcloud command-line tool as a credential helper for authentication
23
+ - name : Configure Docker
24
+ run : |-
25
+ gcloud auth configure-docker us-central1-docker.pkg.dev
26
+
27
+ - name : Verify gcloud configuration
28
+ run : |-
29
+ gcloud config get-value project
30
+
31
+ - name : Set up Docker Buildx
32
+ uses : docker/setup-buildx-action@v1
33
+
34
+ - name : Build and push Docker images
35
+ uses : docker/build-push-action@v2
36
+ with :
37
+ file : dockerfile
38
+ context : .
39
+ platforms : linux/arm64,linux/amd64
40
+ push : true
41
+ tags : us-central1-docker.pkg.dev/genuine-flight-317411/devel/java-toolkit:${{ github.ref_name }}
42
+
43
+ - name : Login to Docker Hub
44
+ uses : docker/login-action@v1
45
+ with :
46
+ username : ${{ secrets.DOCKER_USERNAME }}
47
+ password : ${{ secrets.DOCKER_PASSWORD }}
48
+
49
+ - name : Build and push Docker images Dockerhub
50
+ uses : docker/build-push-action@v2
51
+ with :
52
+ file : dockerfile
53
+ context : .
54
+ platforms : linux/arm64,linux/amd64
55
+ push : true
56
+ tags : robustadev/java-toolkit:${{ github.ref_name }}
0 commit comments