Skip to content

Better editor

Better editor #2

Workflow file for this run

name: Build & Publish
on:
pull_request:
branches: [ main ]
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22' # Specify your Node.js version
- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm run build
- name: Set Docker tag
id: build-info
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
PR_NUMBER=${{ github.event.pull_request.number }}
else
PR_NUMBER="main" # default tag for non-PR builds
fi
echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_ENV
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "DOCKER_TAG=${PR_NUMBER}.${GITHUB_RUN_NUMBER}-beta" >> $GITHUB_ENV
- name: Build and push Docker images
uses: iloveitaly/github-action-nixpacks@main
with:
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }}
${{ env.IMAGE_NAME }}:beta-latest