Skip to content

Commit

Permalink
update: docker release GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
kgrodzicki committed Nov 15, 2023
1 parent 87767cc commit 161172b
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and Publish
name: Build and Push [DockerHub]

on:
push:
tags:
- '*'
- '*.*.*'

env:
IMAGE: flow-pubsub
GITHUB_SHA: ${{ github.sha }}

jobs:
setup-build-publish:
Expand All @@ -15,23 +15,12 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@master

# Setup project version
- name: Get version
id: version
run: |
VERSION="dev"
if [[ "${GITHUB_REF/refs\/tags\//}" != "refs/heads/"* ]] ; then
VERSION="${GITHUB_REF/refs\/tags\//}"
fi
echo ::set-output name=VERSION::${VERSION}
uses: actions/checkout@v3

# Build the Docker image
- name: Build
run: |
VERSION=${{ steps.version.outputs.VERSION }}
DOCKER_VER=${VERSION#"v"}
VERSION=${{github.ref_name}}
docker build \
-t flowlab/"$IMAGE":latest \
-t flowlab/"$IMAGE":"$DOCKER_VER" .
Expand All @@ -40,6 +29,6 @@ jobs:
run: |
docker login --username flowlab --password ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish DockerHub
- name: Publish all tags to DockerHub
run: |
docker push flowlab/$IMAGE
docker push -a flowlab/"$IMAGE"

0 comments on commit 161172b

Please sign in to comment.