Skip to content

Commit

Permalink
Merge pull request #34 from hyperledger/release-tags
Browse files Browse the repository at this point in the history
Create tagged image when publishing a release
  • Loading branch information
peterbroadhurst committed Oct 13, 2021
2 parents e0cba6d + ef04029 commit 7fc4b9f
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-tokens-erc1155:latest .

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

- name: Tag release
if: github.event.action == 'published'
run: docker tag ghcr.io/hyperledger/firefly-tokens-erc1155:${GITHUB_REF##*/} ghcr.io/hyperledger/firefly-tokens-erc1155: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-tokens-erc1155:${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-tokens-erc1155:latest
docker push ghcr.io/hyperledger/firefly-tokens-erc1155:latest

0 comments on commit 7fc4b9f

Please sign in to comment.