Files
gitea-actions-demo-project/.gitea/workflows/build.yml
Nikola Derežić 70e721cc31
Some checks failed
Build and Push Docker Image / build (push) Failing after 6m27s
Initial commit: Gitea Actions demo project with Docker build
Add simple Node.js Hello World application with automated Docker build and
push workflow using Gitea Actions. The workflow builds and pushes images to
the Gitea registry with versioning from package.json.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-09 11:24:17 +01:00

41 lines
1.1 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Read package.json version
id: package-version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
registry.budakova.org/knee-cola/gitea-actions-demo-project:${{ steps.package-version.outputs.version }}
registry.budakova.org/knee-cola/gitea-actions-demo-project:latest
cache-from: type=registry,ref=registry.budakova.org/knee-cola/gitea-actions-demo-project:buildcache
cache-to: type=registry,ref=registry.budakova.org/knee-cola/gitea-actions-demo-project:buildcache,mode=max