File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : build and pull latest docker image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - " main"
7
+ tags :
8
+ - ' [0-9]+.[0-9]+.[0-9]+*'
9
+
10
+ jobs :
11
+ build :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v3
16
+ - name : Get the version
17
+ id : get_version
18
+ run : echo ::set-output name=VERSION::$(git describe --tags --abbrev=0)
19
+ - name : Use the version
20
+ run : echo "The current version is ${{ steps.get_version.outputs.VERSION }}"
21
+ - name : Write version to webapp
22
+ run : echo "VITE_APP_VERSION=${{ steps.get_version.outputs.VERSION }}" >> webapp/.env.production
23
+ - name : Login to Docker Hub
24
+ uses : docker/login-action@v2
25
+ with :
26
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
27
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
28
+ - name : Set up Docker Buildx
29
+ uses : docker/setup-buildx-action@v2
30
+ - name : Build and push
31
+ uses : docker/build-push-action@v3
32
+ with :
33
+ context : .
34
+ file : ./Dockerfile
35
+ push : true
36
+ tags : " ${{ secrets.DOCKERHUB_USERNAME }}/httpymonitor:${{ steps.get_version.outputs.VERSION }}"
You can’t perform that action at this time.
0 commit comments