Skip to content

Publish Docker Image #11

Publish Docker Image

Publish Docker Image #11

Workflow file for this run

name: Publish Docker Image
on:
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag'
required: true
default: 'latest'
type: choice
options:
- dev-latest
- production
push:
tags: [dev-latest, production]
jobs:
push_to_hub:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: nomadnmr/server
tags: |
type=ref,event=tag
type=sha
type=raw,value=${{inputs.tag}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile.serv
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}