Skip to content

Commit 0775e4f

Browse files
authored
feat: add studio rootfs action (#153)
1 parent fe664e2 commit 0775e4f

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: build studio rootfs
2+
# build studio rootfs on ubuntu-latest which contains oocana, python-executor, nodejs-executor, and ovmlayer
3+
on:
4+
pull_request:
5+
paths:
6+
- "layer.dockerfile"
7+
- ".github/workflows/build-studio-rootfs.yaml"
8+
push:
9+
tags:
10+
- "studio-rootfs*"
11+
workflow_dispatch:
12+
13+
jobs:
14+
build-studio:
15+
strategy:
16+
matrix:
17+
platforms: [linux/amd64,linux/arm64]
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Login to GitHub Container Registry
22+
uses: docker/login-action@v3
23+
with:
24+
registry: ghcr.io
25+
username: ${{ github.actor }}
26+
password: ${{ secrets.GITHUB_TOKEN }}
27+
- uses: docker/setup-qemu-action@v3
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
- name: Docker meta
31+
id: meta
32+
uses: docker/metadata-action@v5
33+
with:
34+
images: ghcr.io/${{ github.repository }}
35+
tags: |
36+
type=sha
37+
type=raw,value=local
38+
type=semver,pattern={{version}}
39+
flavor: |
40+
latest=auto
41+
- name: Build and push
42+
uses: docker/build-push-action@v6
43+
with:
44+
context: .
45+
push: false
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}
48+
file: layer.dockerfile
49+
cache-from: type=gha
50+
platforms: ${{ matrix.platforms }}
51+
cache-to: type=gha,mode=max
52+
load: true
53+
- name: export studio rootfs
54+
run: |
55+
if [ ${{ matrix.platforms }} == "linux/amd64" ]; then
56+
docker run --platform ${{ matrix.platforms }} -d --name amd64-studio-rootfs-export ghcr.io/${{ github.repository }}:local true
57+
docker export amd64-studio-rootfs-export >> amd64-studio-rootfs.tar
58+
else
59+
docker run --platform ${{ matrix.platforms }} -d --name arm64-studio-rootfs-export ghcr.io/${{ github.repository }}:local true
60+
docker export arm64-studio-rootfs-export >> arm64-studio-rootfs.tar
61+
fi
62+
- name: tar-name
63+
run: |
64+
if [ ${{ matrix.platforms }} == "linux/amd64" ]; then
65+
echo "tar=amd64-studio-rootfs.tar" >> $GITHUB_OUTPUT
66+
else
67+
echo "tar=arm64-studio-rootfs.tar" >> $GITHUB_OUTPUT
68+
fi
69+
id: tar-name
70+
- name: Release
71+
uses: softprops/action-gh-release@v2
72+
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
73+
with:
74+
files: |
75+
${{ steps.tar-name.outputs.tar }}
76+
token: ${{ secrets.GITHUB_TOKEN }}
77+
body_path: package.json
78+
append_body: false
79+
draft: false
80+
prerelease: false
81+
make_latest: true

layer.dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# syntax=docker/dockerfile:1
2+
# https://github.com/docker/docs/issues/20935
3+
FROM ghcr.io/oomol/server-base:v0.4.1 AS builder
4+
5+
WORKDIR /app

0 commit comments

Comments
 (0)