Skip to content

Commit 409880d

Browse files
committed
update
1 parent e579fa8 commit 409880d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/docker.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
env:
13-
VERSION: $(cat .version)
1412
steps:
1513
- name: Checkout code
1614
uses: actions/checkout@v4
@@ -20,6 +18,11 @@ jobs:
2018
with:
2119
username: ${{ secrets.DOCKERHUB_USERNAME }}
2220
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+
- name: Get version
23+
run: |
24+
VERSION=$(cat ${{ github.workspace }}/.version)
25+
echo "IMAGE_VERSION=${VERSION}" >> $GITHUB_ENV
2326
2427
- name: Build and push Backend
2528
uses: docker/build-push-action@v5
@@ -28,7 +31,9 @@ jobs:
2831
file: deploy/Dockerfile-BE
2932
platforms: linux/amd64,linux/arm64
3033
push: true
31-
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-backend:${{ env.VERSION }}, ${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-backend:latest
34+
tags: |
35+
${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-backend:${{ env.IMAGE_VERSION }}
36+
${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-backend:latest
3237
3338
- name: Build and push Frontend
3439
uses: docker/build-push-action@v5
@@ -37,4 +42,6 @@ jobs:
3742
file: deploy/Dockerfile-FE
3843
platforms: linux/amd64,linux/arm64
3944
push: true
40-
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-frontend:${{ env.VERSION }}, ${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-frontend:latest
45+
tags: |
46+
${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-frontend:${{ env.IMAGE_VERSION }}
47+
${{ secrets.DOCKERHUB_USERNAME }}/ghostsend-frontend:latest

0 commit comments

Comments
 (0)