Skip to content

Update testbuild.yml #9

Update testbuild.yml

Update testbuild.yml #9

Workflow file for this run

name: Production build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install && yarn add autoprefixer
- name: Build the Next.js project
run: |
echo "🚀 Starting build..."
yarn build || (echo "❌ Build failed! Full logs:" && cat .next/output.log && exit 1)
# Docker steps will only run for Node.js 22.x
- name: Log in to GitHub Container Registry
if: matrix.node-version == '22.x'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Docker image
if: matrix.node-version == '22.x'
run: |

Check failure on line 43 in .github/workflows/testbuild.yml

View workflow run for this annotation

GitHub Actions / Production build

Invalid workflow file

The workflow is not valid. .github/workflows/testbuild.yml (Line: 43, Col: 12): Unexpected symbol: '|'. Located at position 25 within expression: github.repository_owner | toLowerCase() .github/workflows/testbuild.yml (Line: 49, Col: 12): Unexpected symbol: '|'. Located at position 25 within expression: github.repository_owner | toLowerCase()
echo "🐳 Building Docker image..."
docker build -t ghcr.io/${{ github.repository_owner | toLowerCase() }}/${{ github.repository | toLowerCase() }}:latest .
- name: Push Docker image to GHCR
if: matrix.node-version == '22.x'
run: |
echo "📦 Pushing Docker image to GitHub Container Registry..."
docker push ghcr.io/${{ github.repository_owner | toLowerCase() }}/${{ github.repository | toLowerCase() }}:latest