Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Create Docker Image #45

Create Docker Image

Create Docker Image #45

Workflow file for this run

name: Create Docker Image
on:
workflow_dispatch:
inputs:
filename:
description: Name of the Docker image configuration to build
required: true
default: Dockerfile.gnat
username:
description: Name of the Docker user
required: true
default: thindil
name:
description: Name of the Docker image
required: true
default: gnat
version:
description: Version of the Docker image
required: true
default: 9
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build the Docker image
run: docker image build -f ${{ github.event.inputs.filename }} -t ghcr.io/${{ github.event.inputs.username }}/${{ github.event.inputs.name }}:${{ github.event.inputs.version }} .
- name: Log in to the Github Container Registry
run: echo ${{ secrets.DOCKER_PASS }} | docker login ghcr.io --username=${{ github.event.inputs.username }} --password-stdin
- name: Upload images to the Github Container Registry
run: docker push ghcr.io/${{ github.event.inputs.username }}/${{ github.event.inputs.name }}:${{ github.event.inputs.version }}