Skip to content

Commit

Permalink
pull new ci tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Aug 10, 2023
1 parent d1b84e0 commit 12bfdf1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
tags:
- '*'

jobs:
backend_test_build_and_push_to_docker_registry: #disable backend in test branch
Expand All @@ -22,10 +24,21 @@ 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-stats-service:latest" >> $GITHUB_OUTPUT
else
echo "name=xinfinorg/subnet-stats-service:${{github.ref_name}}" >> $GITHUB_OUTPUT
fi
- name: Docker build and tag image
run: cd backend && docker build . --file Dockerfile --tag xinfinorg/subnet-stats-service:latest
run: cd backend && docker build . --file Dockerfile --tag ${{ steps.image.outputs.name }}

- name: Docker push
run: docker push xinfinorg/subnet-stats-service:latest
run: docker push ${{ steps.image.outputs.name }}

frontend_test_build_and_push_to_docker_registry:
name: build and publish frontend image to docker hub
Expand All @@ -45,3 +58,4 @@ jobs:
run: cd frontend && docker build . --file Dockerfile --tag xinfinorg/subnet-frontend:latest
- name: Docker push
run: docker push xinfinorg/subnet-frontend:latest

0 comments on commit 12bfdf1

Please sign in to comment.