Skip to content

Commit cc6a3b5

Browse files
authored
Update docker release build GitHub action (#55)
Signed-off-by: Nicko Guyer <[email protected]>
1 parent dc5164a commit cc6a3b5

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker
1+
name: Docker Release Build
22

33
on:
44
release:
@@ -9,21 +9,35 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
1214

1315
- name: Build
14-
run: docker build -t ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/} .
15-
16+
run: |
17+
docker build \
18+
--label commit=$GITHUB_SHA \
19+
--label build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
20+
--label tag=${GITHUB_REF##*/} \
21+
--tag ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/}" \
22+
--tag ghcr.io/hyperledger/firefly-dataexchange-https:head" \
23+
.
24+
1625
- name: Tag release
1726
if: github.event.action == 'released'
1827
run: docker tag ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/} ghcr.io/hyperledger/firefly-dataexchange-https:latest
19-
28+
2029
- name: Push docker image
2130
run: |
2231
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
2332
docker push ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/}
2433
34+
- name: Push head tag
35+
run: |
36+
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
37+
docker push ghcr.io/hyperledger/firefly-dataexchange-https:head
38+
2539
- name: Push latest tag
2640
if: github.event.action == 'released'
2741
run: |
2842
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
29-
docker push ghcr.io/hyperledger/firefly-dataexchange-https:latest
43+
docker push ghcr.io/hyperledger/firefly-dataexchange-https:latest

0 commit comments

Comments
 (0)