Skip to content

Commit 715902a

Browse files
authored
Update build_and_push.yml
1 parent 9fd8149 commit 715902a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/build_and_push.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ jobs:
1818
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
1919
run: |
2020
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
21-
- name: Build the Docker image
22-
run: |
23-
docker build -t hexydev/spacebox-crawler:latest -t hexydev/spacebox-crawler:${{github.ref_name}} --target=app .
24-
- name: push to registry
25-
run: |
26-
docker push hexydev/spacebox-crawler:${{github.ref_name}}
27-
docker push hexydev/spacebox-crawler:latest
21+
- name: Build specify tag
22+
run: docker build -t hexydev/spacebox-crawler:${{github.ref_name}} --target=app .
23+
- name: Build latest tag
24+
if: startsWith(github.ref, 'refs/tags/v')
25+
run: docker build -t hexydev/spacebox-crawler:latest --target=app .
26+
- name: push specify tag to registry
27+
run: docker push hexydev/spacebox-crawler:${{github.ref_name}}
28+
- name: push latest tag to registry
29+
if: startsWith(github.ref, 'refs/tags/v')
30+
run: docker push hexydev/spacebox-crawler:latest

0 commit comments

Comments
 (0)