baktainer/.forgejo/workflows/build.yml
James Paterni e294b9b1a3
Some checks failed
Build Docker Image / build (push) Failing after 31s
Minimal CI / test (push) Failing after 10s
Node+Ruby CI Pipeline / build (push) Blocked by required conditions
Node+Ruby CI Pipeline / notify (push) Blocked by required conditions
CI Pipeline / test (push) Failing after 36s
Build and Push Docker Image / test (push) Failing after 12s
Build Docker Image / notify (push) Failing after 1s
CI Pipeline / build (push) Has been skipped
Build and Push Docker Image / build (push) Has been skipped
Simple CI Pipeline / build (push) Has been skipped
CI Pipeline / notify (push) Successful in 1s
Simple CI Pipeline / notify (push) Successful in 1s
Simple CI Pipeline / test (push) Failing after 1s
Run Tests / test (push) Failing after 12s
Minimal CI / build (push) Has been skipped
Node+Ruby CI Pipeline / test (push) Has been cancelled
Fix Node.js executable error in Forgejo Actions workflows
- Install Node.js before checkout in all workflows that use actions
- Updated ci.yml, test.yml, build.yml, and docker.yml
- Updated README.md with fix information
- Resolves "exec: node: executable file not found in $PATH" error

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 11:25:02 -04:00

67 lines
No EOL
1.8 KiB
YAML

name: Build Docker Image
on:
push:
branches:
- main
tags:
- 'v*.*.*'
jobs:
build:
runs-on: docker
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
steps:
- name: Install Node.js for actions
run: |
apk add --no-cache nodejs npm
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version tag
id: version
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
echo "VERSION_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Set image tags
id: tags
run: |
IMAGE_NAME=${{ secrets.DOCKER_IMAGE_NAME }}
TAGS="${IMAGE_NAME}:latest"
if [ -n "${{ steps.version.outputs.VERSION_TAG }}" ]; then
TAGS="$TAGS,${IMAGE_NAME}:${{ steps.version.outputs.VERSION_TAG }}"
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.tags.outputs.tags }}
notify:
needs: build
runs-on: docker
if: always()
steps:
- name: Notify build status
run: |
if [ "${{ needs.build.result }}" == "success" ]; then
echo "✅ Docker image built and pushed successfully"
echo "🏷️ Tags: ${{ needs.build.outputs.tags }}"
else
echo "❌ Docker image build failed"
exit 1
fi