1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ name : Publish Docker image
11
+
12
+ on :
13
+ # Triggers the workflow on push or pull request events but only for the "main" branch
14
+ push :
15
+ branches : [ "main", "github-ci" ]
16
+ pull_request :
17
+ branches : [ "main", "github-ci" ]
18
+
19
+ jobs :
20
+ push_to_registry :
21
+ name : Push Docker image to Docker Hub
22
+ runs-on : ubuntu-latest
23
+ steps :
24
+ - name : Check out the repo
25
+ uses : actions/checkout@v4.1.1
26
+
27
+ - name : Log in to Docker Hub
28
+ uses : docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
29
+ with :
30
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
31
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
32
+
33
+ - name : Extract metadata (tags, labels) for Docker
34
+ id : meta
35
+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
36
+ with :
37
+ images : georgedavisibexlabs/publish-sarif-to-jira
38
+
39
+ - name : Build and push Docker image
40
+ uses : docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
41
+ with :
42
+ context : .
43
+ file : ./Dockerfile
44
+ push : true
45
+ tags : ${{ steps.meta.outputs.tags }}
46
+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments