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
- 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>
90 lines
No EOL
2.3 KiB
YAML
90 lines
No EOL
2.3 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: docker
|
|
container:
|
|
image: ruby:3.3-alpine
|
|
defaults:
|
|
run:
|
|
working-directory: ./app
|
|
|
|
steps:
|
|
- name: Install system dependencies including Node.js
|
|
run: |
|
|
apk add --no-cache build-base libffi-dev linux-headers postgresql-dev git nodejs npm
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Ruby dependencies
|
|
run: |
|
|
gem install bundler -v 2.6.7
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
|
|
- name: Run RSpec tests
|
|
run: |
|
|
mkdir -p tmp
|
|
bundle exec rspec \
|
|
--format progress \
|
|
--format RspecJunitFormatter \
|
|
--out tmp/rspec_results.xml
|
|
|
|
- name: Upload test results
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: rspec-results
|
|
path: app/tmp/rspec_results.xml
|
|
|
|
build:
|
|
needs: test
|
|
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: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ secrets.DOCKER_IMAGE_NAME }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=ref,event=pr
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max |