All checks were successful
Build and Push Presejpacky Docker Image / build-and-push (push) Successful in 50s
47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
name: Build and Push Presejpacky Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: 'Image tag'
|
|
required: true
|
|
default: 'latest'
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'drills/flat-stack-presejpacky/**'
|
|
tags:
|
|
- 'presejpacky-v*'
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea registry
|
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login -u ${{ github.actor }} --password-stdin gitea.home.hrajfrisbee.cz
|
|
|
|
- name: Build and push image
|
|
run: |
|
|
TAG=${{ github.ref_name }}
|
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
TAG=${{ inputs.tag }}
|
|
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
|
TAG="latest"
|
|
fi
|
|
IMAGE=gitea.home.hrajfrisbee.cz/${{ github.repository_owner }}/flat-stack-presejpacky:$TAG
|
|
docker build -f drills/flat-stack-presejpacky/Dockerfile \
|
|
--build-arg GIT_TAG=$TAG \
|
|
--build-arg GIT_COMMIT=${{ github.sha }} \
|
|
--build-arg BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
|
|
-t $IMAGE drills/flat-stack-presejpacky
|
|
docker push $IMAGE
|