Files
hidden11/.gitea/workflows/build-and-push.yaml
T
alexandrev-tibco 426aa3ce70
Build and push image / build (push) Failing after 5s
Use direct docker commands in Gitea workflow
2026-05-03 11:50:19 +02:00

44 lines
1.3 KiB
YAML

name: Build and push image
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: gitea.alexandre-vazquez.cloud
IMAGE_NAME: alexandrev/hidden11
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set image tags
id: meta
run: |
SHORT_SHA="${GITHUB_SHA::12}"
echo "sha_tag=${REGISTRY}/${IMAGE_NAME}:${SHORT_SHA}" >> "$GITHUB_OUTPUT"
echo "latest_tag=${REGISTRY}/${IMAGE_NAME}:latest" >> "$GITHUB_OUTPUT"
- name: Login to Gitea registry
run: |
printf '%s' "${{ secrets.REGISTRY_TOKEN }}" \
| docker login "${REGISTRY}" \
--username "${{ secrets.REGISTRY_USERNAME }}" \
--password-stdin
- name: Build and push
run: |
docker build \
--label "org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
--label "org.opencontainers.image.revision=${GITHUB_SHA}" \
--tag "${{ steps.meta.outputs.sha_tag }}" \
--tag "${{ steps.meta.outputs.latest_tag }}" \
.
docker push "${{ steps.meta.outputs.sha_tag }}"
docker push "${{ steps.meta.outputs.latest_tag }}"