Skip to content

Commit

Permalink
Create tagged image when publishing a release (#43)
Browse files Browse the repository at this point in the history
Signed-off-by: Nicko Guyer <nicko.guyer@kaleido.io>
  • Loading branch information
nguyer authored Oct 13, 2021
1 parent 608641a commit 4b59e43
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Docker

on:
push:
branches:
- main
release:
types: [published, prereleased]

jobs:
docker:
Expand All @@ -12,9 +11,19 @@ jobs:
- uses: actions/checkout@v2

- name: Build
run: docker build -t ghcr.io/hyperledger/firefly-dataexchange-https:latest .

- name: Push
run: docker build -t ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/} .

- name: Tag release
if: github.event.action == 'published'
run: docker tag ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/} ghcr.io/hyperledger/firefly-dataexchange-https:latest

- name: Push docker image
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/}
- name: Push latest tag
if: github.event.action == 'published'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push ghcr.io/hyperledger/firefly-dataexchange-https:latest
docker push ghcr.io/hyperledger/firefly-dataexchange-https:latest

0 comments on commit 4b59e43

Please sign in to comment.