Skip to content

Update testbuild.yml #8

Update testbuild.yml

Update testbuild.yml #8

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)
- name: Log in to GitHub Container Registry
if: success()
run: echo "${{ secrets.LOGIN_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build Docker image
if: success()
run: |
echo "🐳 Building Docker image..."
docker build -t ghcr.io/${{ github.repository_owner }}/innenanzeiger:latest .
- name: Push Docker image to Container Registry
if: success()
run: |
echo "📦 Pushing Docker image to GitHub Container Registry..."
docker push ghcr.io/${{ github.repository_owner }}/innenanzeiger:latest