Skip to content

Commit 679049e

Browse files
committed
CI: update to the latest Docker actions
1 parent d51972b commit 679049e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,25 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- name: Build and Push Docker Images
22-
uses: docker/build-push-action@v6
21+
- name: Extract metadata for Docker
22+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: codingteam/codingteam.org.ru
27+
tags: type=ref,event=branch
28+
29+
- name: Login to Docker Hub
30+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
31+
uses: docker/login-action@v3
2332
with:
2433
username: ${{ secrets.DOCKER_USERNAME }}
2534
password: ${{ secrets.DOCKER_PASSWORD }}
26-
repository: codingteam/codingteam.org.ru
27-
tag_with_ref: true
28-
tags: latest
35+
36+
- name: Build and Push Docker Images
37+
uses: docker/build-push-action@v6
38+
with:
39+
tags: |
40+
${{ steps.meta.outputs.tags }}
41+
codingteam/codingteam.org.ru:latest
2942
push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') && 'true' || 'false' }}

0 commit comments

Comments
 (0)