Skip to content

Set the image name in the release ci workflow #2

Set the image name in the release ci workflow

Set the image name in the release ci workflow #2

Workflow file for this run

name: Docker Hub
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '!v[0-9]+.[0-9]+.[0-9]+[ab][0-9]+'
env:
REPO: csdms/bmi-example-python
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Get version
id: vars
run: echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ${REPO}:latest,${REPO}:${{ steps.vars.outputs.version }}