Skip to content

Publish Docker image #2

Publish Docker image

Publish Docker image #2

Workflow file for this run

name: Publish Docker image
on:
push:
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
version:
description: 'Version to publish'
required: true
jobs:
build_and_push:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker image
uses: docker/build-push-action@v6
if: github.event_name == 'workflow_dispatch'
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/helios:${{ github.event.inputs.version }}
- name: Set tag as output
if: github.event_name == 'push'
run: echo "tag=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
- name: Build Docker image
uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/helios:${{ env.tag }}