-
Notifications
You must be signed in to change notification settings - Fork 15
106 lines (86 loc) · 3.02 KB
/
Copy pathnightly-build.yml
File metadata and controls
106 lines (86 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# 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 }}"