Skip to content

NeXroll 2.0.0-beta.10 #177

NeXroll 2.0.0-beta.10

NeXroll 2.0.0-beta.10 #177

Workflow file for this run

name: Build and Push Docker Image
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version tag (e.g., v1.10.14)'
required: true
default: ''
env:
REGISTRY: docker.io
IMAGE_NAME: jbrns/nexroll
# GitHub forces Node 24 for JS actions from 2026-06-16; opt in now so the
# switch is validated on our schedule. Safe to delete after 2026-09-16
# (Node 20 removed from runners entirely).
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Get version
id: version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
IS_PRERELEASE="${{ github.event.release.prerelease }}"
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
# Check if version contains beta/rc/alpha
if [[ "$VERSION" =~ (beta|rc|alpha) ]]; then
IS_PRERELEASE="true"
else
IS_PRERELEASE="false"
fi
fi
# Remove 'v' prefix for Docker tag
VERSION_NUM="${VERSION#v}"
echo "version=${VERSION_NUM}" >> $GITHUB_OUTPUT
echo "tag=${VERSION}" >> $GITHUB_OUTPUT
echo "is_prerelease=${IS_PRERELEASE}" >> $GITHUB_OUTPUT
echo "Version: ${VERSION_NUM}"
echo "Is Pre-release: ${IS_PRERELEASE}"
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: NeXroll/frontend/package-lock.json
- name: Build frontend
working-directory: NeXroll/frontend
env:
CI: false
run: |
npm ci
npm run build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- 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.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Determine Docker tags
id: docker_tags
run: |
VERSION="${{ steps.version.outputs.version }}"
IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}"
if [ "$IS_PRERELEASE" = "true" ]; then
# Pre-release: tag with version and 'beta'
echo "tags=${{ env.IMAGE_NAME }}:${VERSION},${{ env.IMAGE_NAME }}:beta" >> $GITHUB_OUTPUT
echo "Using beta tags: ${VERSION}, beta"
else
# Stable release: tag with version and 'latest'
echo "tags=${{ env.IMAGE_NAME }}:${VERSION},${{ env.IMAGE_NAME }}:latest" >> $GITHUB_OUTPUT
echo "Using stable tags: ${VERSION}, latest"
fi
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_tags.outputs.tags }}
build-args: |
VERSION=${{ steps.version.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max