update: fix doc #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
IMAGE: flow-pubsub | |
jobs: | |
setup-build-publish: | |
name: Setup, Build and Publish | |
runs-on: ubuntu-latest | |
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} | |
# Build the Docker image | |
- name: Build | |
run: | | |
VERSION=${{ steps.version.outputs.VERSION }} | |
DOCKER_VER=${VERSION#"v"} | |
docker build \ | |
-t flowlab/"$IMAGE":latest \ | |
-t flowlab/"$IMAGE":"$DOCKER_VER" . | |
- name: Setup DockerHub | |
run: | | |
docker login --username flowlab --password ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Publish DockerHub | |
run: | | |
docker push flowlab/$IMAGE |