File tree 2 files changed +4
-33
lines changed
2 files changed +4
-33
lines changed Original file line number Diff line number Diff line change 1
- name : build and pull latest docker image
1
+ name : build and pull latest or versioned docker image
2
2
3
3
on :
4
4
push :
5
5
branches :
6
6
- " main"
7
- tags :
8
- - ' [0-9]+.[0-9]+.[0-9]+*'
9
7
10
8
jobs :
11
9
build :
15
13
uses : actions/checkout@v3
16
14
- name : Get the version
17
15
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 }}"
16
+ run : |
17
+ VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo 'latest')
18
+ echo ::set-output name=VERSION::${ VERSION}
21
19
- name : Write version to webapp
22
20
run : echo "VITE_APP_VERSION=${{ steps.get_version.outputs.VERSION }}" >> webapp/.env.production
23
21
- name : Login to Docker Hub
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments