File tree Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: Docker Build and Push
2
2
3
3
on :
4
4
push :
5
+ branches :
6
+ - main
7
+ tags :
8
+ - ' v*'
5
9
paths :
6
10
- ' src/**'
7
11
- ' .dockerignore'
11
15
- ' Dockerfile'
12
16
- ' package.json'
13
17
- ' package-lock.json'
14
- branches :
15
- - main
16
18
17
19
jobs :
18
20
build-and-push :
21
+ if : github.ref == 'refs/heads/main'
19
22
runs-on : ubuntu-latest
20
23
steps :
21
24
- name : Checkout code
22
25
uses : actions/checkout@v4
23
26
24
27
- name : Set up Node.js
25
28
uses : actions/setup-node@v4
26
-
27
29
with :
28
30
node-version : 22
29
31
cache : ' npm'
57
59
tags : xcrypt0r/watchdog:latest
58
60
cache-from : type=gha
59
61
cache-to : type=gha,mode=max
62
+
63
+ update-release :
64
+ if : startsWith(github.ref, 'refs/tags/')
65
+ runs-on : ubuntu-latest
66
+ steps :
67
+ - name : Checkout code
68
+ uses : actions/checkout@v4
69
+
70
+ - name : Strip "v" from tag
71
+ id : strip
72
+ run : echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
73
+
74
+ - name : Update GitHub Release
75
+ uses : softprops/action-gh-release@v1
76
+ with :
77
+ tag_name : ${{ github.ref_name }}
78
+ name : Watchdog ${{ steps.strip.outputs.version }}
79
+ body : |
80
+ 🐳 Docker image pushed
81
+
82
+ ```
83
+ docker pull xcrypt0r/watchdog:latest
84
+ ```
85
+
86
+ [View on Docker Hub](https://hub.docker.com/r/xcrypt0r/watchdog)
87
+ env :
88
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments