Skip to content

Commit 99b14c4

Browse files
authored
Add Tags for Docker Images (alshedivat#754)
1 parent b6ea0d0 commit 99b14c4

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docker Image CI (Upload Tag)
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
- name: Buildx
18+
uses: docker/setup-buildx-action@v1
19+
20+
-
21+
name: Docker meta
22+
id: meta
23+
uses: docker/metadata-action@v4
24+
with:
25+
images: amirpourmand/al-folio
26+
27+
- name: Login
28+
uses: docker/login-action@v1
29+
with:
30+
username: ${{ secrets.DOCKER_USERNAME }}
31+
password: ${{ secrets.DOCKER_PASSWORD }}
32+
33+
- name: Build and push
34+
uses: docker/build-push-action@v3
35+
with:
36+
context: .
37+
push: ${{ github.event_name != 'pull_request' }}
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}
40+

.github/workflows/deploy-image.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@ name: Docker Image CI
33
on:
44
push:
55
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
86

97
jobs:
108

119
build:
1210

1311
runs-on: ubuntu-latest
1412
if: github.repository_owner == 'alshedivat'
15-
13+
1614
steps:
1715
- name: Checkout
1816
uses: actions/checkout@v2
@@ -24,7 +22,7 @@ jobs:
2422
with:
2523
username: ${{ secrets.DOCKER_USERNAME }}
2624
password: ${{ secrets.DOCKER_PASSWORD }}
27-
25+
2826
- name: Build and push
2927
uses: docker/build-push-action@v2
3028
with:

0 commit comments

Comments
 (0)