Skip to content

Commit 6ac1e7b

Browse files
Update manual-export workflow configuration
1 parent a547f48 commit 6ac1e7b

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Manual Build and Export
2+
3+
on:
4+
# Trigger manually
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Version Tag (e.g., dev-v2025.12.21.a)'
9+
required: true
10+
type: string
11+
12+
env:
13+
IMAGE_NAME: openbiocard-server
14+
DOCKERFILE_PATH: ./Dockerfile
15+
16+
jobs:
17+
build-and-export:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
22+
steps:
23+
- name: Checkout Release Branch
24+
uses: actions/checkout@v4
25+
with:
26+
ref: release
27+
28+
- name: Build Docker Image
29+
run: |
30+
echo "Building image with tag: ${{ inputs.version }}"
31+
# Build the image locally
32+
docker build -f ${{ env.DOCKERFILE_PATH }} -t ${{ env.IMAGE_NAME }}:${{ inputs.version }} .
33+
34+
- name: Save Image to File
35+
run: |
36+
# Define filenames
37+
TAR_NAME="${{ env.IMAGE_NAME }}-${{ inputs.version }}.tar"
38+
39+
echo "Saving image to $TAR_NAME..."
40+
# Export the image to a tarball
41+
docker save ${{ env.IMAGE_NAME }}:${{ inputs.version }} -o $TAR_NAME
42+
43+
# Optional: Compress with gzip to save space
44+
echo "Compressing..."
45+
gzip $TAR_NAME
46+
47+
echo "FILE_PATH=$TAR_NAME.gz" >> $GITHUB_ENV
48+
49+
- name: Upload Artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
# Name of the artifact in GitHub UI
53+
name: docker-image-${{ inputs.version }}
54+
# The file to upload
55+
path: ${{ env.FILE_PATH }}
56+
# Retention period (days)
57+
retention-days: 3

0 commit comments

Comments
 (0)