feat(workflows): add workflow for building docker images
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
image_name:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
docker_context:
|
||||
required: false
|
||||
type: string
|
||||
default: "."
|
||||
|
||||
dockerfile:
|
||||
required: false
|
||||
type: string
|
||||
default: "Dockerfile"
|
||||
|
||||
tag:
|
||||
required: false
|
||||
type: string
|
||||
default: "develop"
|
||||
|
||||
secrets:
|
||||
REGISTRY_USER:
|
||||
required: true
|
||||
|
||||
REGISTRY_TOKEN:
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.itlab-ffeks.dnu.edu.ua
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: ${{ inputs.docker_context }}
|
||||
file: ${{ inputs.dockerfile }}
|
||||
push: true
|
||||
tags: |
|
||||
git.itlab-ffeks.dnu.edu.ua/${{ gitea.repository_owner }}/${{ inputs.image_name }}:${{ inputs.tag }}
|
||||
Reference in New Issue
Block a user