From 4ce13f01f3282df134bb17ae6a1aadf24eaa6901 Mon Sep 17 00:00:00 2001 From: Wanwiset Peerapatanapokin Date: Thu, 10 Aug 2023 11:13:47 +0400 Subject: [PATCH] fix ci --- .github/workflows/ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e2b137..8045281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,8 +54,17 @@ jobs: DOCKER_PASSWORD: ${{secrets.DOCKER_ACCESS_TOKEN}} run: | echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - name: Determine Docker Image Name + id: image + run: | + if [[ "${{github.ref_name}}" == "master" ]]; then + echo "name=xinfinorg/subnet-frontend:latest" >> $GITHUB_OUTPUT + else + echo "name=xinfinorg/subnet-frontend:${{github.ref_name}}" >> $GITHUB_OUTPUT + fi + - name: Docker build and tag image - run: cd frontend && docker build . --file Dockerfile --tag xinfinorg/subnet-frontend:latest - - name: Docker push - run: docker push xinfinorg/subnet-frontend:latest + run: cd frontend && docker build . --file Dockerfile --tag ${{ steps.image.outputs.name }} + - name: Docker push + run: docker push ${{ steps.image.outputs.name }} \ No newline at end of file