Skip to content

Commit e9f47f0

Browse files
committed
fix: CI docker pull with version
1 parent 78c3f66 commit e9f47f0

File tree

2 files changed

+4
-33
lines changed

2 files changed

+4
-33
lines changed

.github/workflows/main-versioned-docker-pull.yml .github/workflows/main-docker-pull.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
name: build and pull latest docker image
1+
name: build and pull latest or versioned docker image
22

33
on:
44
push:
55
branches:
66
- "main"
7-
tags:
8-
- '[0-9]+.[0-9]+.[0-9]+*'
97

108
jobs:
119
build:
@@ -15,9 +13,9 @@ jobs:
1513
uses: actions/checkout@v3
1614
- name: Get the version
1715
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}
2119
- name: Write version to webapp
2220
run: echo "VITE_APP_VERSION=${{ steps.get_version.outputs.VERSION }}" >> webapp/.env.production
2321
- name: Login to Docker Hub

.github/workflows/main-latest-docker-pull.yml

-27
This file was deleted.

0 commit comments

Comments
 (0)