From bd0672e49d7c5def567d18b4aef2ca8cd50028d0 Mon Sep 17 00:00:00 2001 From: Jan Novak Date: Sun, 7 Jun 2026 23:29:40 +0200 Subject: [PATCH] ci: update build-presejpacky workflow to match validated Gitea template --- .gitea/workflows/build-presejpacky.yml | 52 +++++++++++++------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/build-presejpacky.yml b/.gitea/workflows/build-presejpacky.yml index a838153..a0ad6fd 100644 --- a/.gitea/workflows/build-presejpacky.yml +++ b/.gitea/workflows/build-presejpacky.yml @@ -1,6 +1,12 @@ name: Build and Push Presejpacky Docker Image on: + workflow_dispatch: + inputs: + tag: + description: 'Image tag' + required: true + default: 'latest' push: branches: - main @@ -12,35 +18,29 @@ on: jobs: build-and-push: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - 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: 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 - uses: docker/build-push-action@v6 - with: - context: drills/flat-stack-presejpacky - file: drills/flat-stack-presejpacky/Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + 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