ci: update build-presejpacky workflow to match validated Gitea template
All checks were successful
Build and Push Presejpacky Docker Image / build-and-push (push) Successful in 50s
All checks were successful
Build and Push Presejpacky Docker Image / build-and-push (push) Successful in 50s
This commit is contained in:
@@ -1,6 +1,12 @@
|
|||||||
name: Build and Push Presejpacky Docker Image
|
name: Build and Push Presejpacky Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: 'Image tag'
|
||||||
|
required: true
|
||||||
|
default: 'latest'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
@@ -12,35 +18,29 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Login to Gitea registry
|
||||||
uses: docker/setup-buildx-action@v3
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login -u ${{ github.actor }} --password-stdin gitea.home.hrajfrisbee.cz
|
||||||
|
|
||||||
- name: Log in to Gitea Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: gitea.home.hrajfrisbee.cz
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
gitea.home.hrajfrisbee.cz/${{ github.repository_owner }}/flat-stack-presejpacky
|
|
||||||
tags: |
|
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
|
||||||
type=match,pattern=presejpacky-v(.*),group=1
|
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
uses: docker/build-push-action@v6
|
run: |
|
||||||
with:
|
TAG=${{ github.ref_name }}
|
||||||
context: drills/flat-stack-presejpacky
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
file: drills/flat-stack-presejpacky/Dockerfile
|
TAG=${{ inputs.tag }}
|
||||||
push: true
|
elif [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
TAG="latest"
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user