Skip to content

Nightly Build

Nightly Build #2

Workflow file for this run

# LinaPro nightly multi-platform Docker image publishing workflow.
# GitHub cron uses UTC. 16:00 UTC is 00:00 Asia/Shanghai.
name: Nightly Build
on:
schedule:
- cron: "0 16 * * *"
workflow_dispatch:
permissions:
contents: read
packages: write
concurrency:
group: "${{ github.workflow }} @ nightly"
cancel-in-progress: false
env:
TZ: "Asia/Shanghai"
IMAGE_NAME: "linapro"
PLATFORMS: "linux/amd64,linux/arm64"
jobs:
nightly-image:
name: Build and publish nightly image
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.25"
cache-dependency-path: "**/go.sum"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: "10.30.3"
run_install: false
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version-file: "apps/lina-vben/.node-version"
cache: "pnpm"
cache-dependency-path: "apps/lina-vben/pnpm-lock.yaml"
- name: Install Frontend Dependencies
working-directory: apps/lina-vben
run: pnpm install --frozen-lockfile
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Image Metadata
id: image
run: |
owner="$(printf '%s' "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
image_name="$(printf '%s' "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')"
registry="ghcr.io/${owner}"
date_tag="nightly-$(date +'%Y%m%d')"
image_ref="${registry}/${image_name}"
{
echo "registry=${registry}"
echo "image_name=${image_name}"
echo "date_tag=${date_tag}"
echo "image_ref=${image_ref}"
} >> "${GITHUB_OUTPUT}"
echo "Publishing ${image_ref}:${date_tag} for ${PLATFORMS}"
- name: Build and Push Multi-Platform Image
run: |
make image \
config=".github/workflows/nightly-build/config.yaml" \
platforms="${PLATFORMS}" \
registry="${{ steps.image.outputs.registry }}" \
image="${{ steps.image.outputs.image_name }}" \
tag="${{ steps.image.outputs.date_tag }}" \
push=1
- name: Publish Floating Nightly Tag
run: |
docker buildx imagetools create \
--tag "${{ steps.image.outputs.image_ref }}:nightly" \
"${{ steps.image.outputs.image_ref }}:${{ steps.image.outputs.date_tag }}"
- name: Inspect Published Manifest
run: |
docker buildx imagetools inspect "${{ steps.image.outputs.image_ref }}:${{ steps.image.outputs.date_tag }}"