Skip to content

Commit 60e12fa

Browse files
committed
ci: added workflows
1 parent e636476 commit 60e12fa

3 files changed

Lines changed: 205 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Push cuos-image-factory (Multi-Arch)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
paths:
10+
- image-factory/**
11+
- .github/workflows/docker-image-factory.yml
12+
workflow_dispatch:
13+
14+
jobs:
15+
build-and-push:
16+
if: github.event_name != 'pull_request'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v5
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Set image tag
39+
id: vars
40+
run: |
41+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
42+
TAG=${GITHUB_REF#refs/tags/}
43+
elif [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
44+
TAG=latest
45+
else
46+
TAG=${GITHUB_REF#refs/heads/}
47+
TAG=${TAG//\//-}
48+
fi
49+
echo "tag=$TAG" >> $GITHUB_OUTPUT
50+
51+
- name: Build and push Docker image - cuos-image-factory
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: ./
55+
file: ./image-factory/Dockerfile
56+
push: true
57+
tags: |
58+
ghcr.io/${{ github.repository_owner }}/cuos-image-factory:${{ steps.vars.outputs.tag }}
59+
labels: |
60+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
61+
org.opencontainers.image.revision=${{ github.sha }}
62+
org.opencontainers.image.created=${{ github.run_id }}
63+
org.opencontainers.image.version=${{ steps.vars.outputs.tag }}
64+
#platforms: linux/amd64,linux/arm64,linux/arm/v7
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build and Push cuos-system (Multi-Arch)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
paths:
10+
- system/**
11+
- .github/workflows/docker-system.yml
12+
workflow_dispatch:
13+
14+
jobs:
15+
build-and-push:
16+
if: github.event_name != 'pull_request'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v5
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Set image tag
39+
id: vars
40+
run: |
41+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
42+
TAG=${GITHUB_REF#refs/tags/}
43+
elif [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
44+
TAG=latest
45+
else
46+
TAG=${GITHUB_REF#refs/heads/}
47+
TAG=${TAG//\//-}
48+
fi
49+
echo "tag=$TAG" >> $GITHUB_OUTPUT
50+
51+
- name: Build and push Docker image - cuos-system
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: ./system
55+
push: true
56+
tags: |
57+
ghcr.io/${{ github.repository_owner }}/cuos-system:${{ steps.vars.outputs.tag }}
58+
labels: |
59+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
60+
org.opencontainers.image.revision=${{ github.sha }}
61+
org.opencontainers.image.created=${{ github.run_id }}
62+
org.opencontainers.image.version=${{ steps.vars.outputs.tag }}
63+
#platforms: linux/amd64,linux/arm64,linux/arm/v7
64+
65+
- name: Build and push Docker image - cuos-system-lxc
66+
uses: docker/build-push-action@v6
67+
with:
68+
context: ./system
69+
file: ./Dockerfile.lxc
70+
push: true
71+
tags: |
72+
ghcr.io/${{ github.repository_owner }}/cuos-system-lxc:${{ steps.vars.outputs.tag }}
73+
labels: |
74+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
75+
org.opencontainers.image.revision=${{ github.sha }}
76+
org.opencontainers.image.created=${{ github.run_id }}
77+
org.opencontainers.image.version=${{ steps.vars.outputs.tag }}
78+
#platforms: linux/amd64,linux/arm64,linux/arm/v7
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build and Push cuos-updater (Multi-Arch)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '*'
9+
paths:
10+
- updater/**
11+
- .github/workflows/docker-updater.yml
12+
workflow_dispatch:
13+
14+
jobs:
15+
build-and-push:
16+
if: github.event_name != 'pull_request'
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v5
24+
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v3
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Login to GitHub Container Registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Set image tag
39+
id: vars
40+
run: |
41+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
42+
TAG=${GITHUB_REF#refs/tags/}
43+
elif [[ "$GITHUB_REF" == "refs/heads/main" ]]; then
44+
TAG=latest
45+
else
46+
TAG=${GITHUB_REF#refs/heads/}
47+
TAG=${TAG//\//-}
48+
fi
49+
echo "tag=$TAG" >> $GITHUB_OUTPUT
50+
51+
- name: Build and push Docker image - cuos-updater
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: ./updater
55+
push: true
56+
tags: |
57+
ghcr.io/${{ github.repository_owner }}/cuos-updater:${{ steps.vars.outputs.tag }}
58+
labels: |
59+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
60+
org.opencontainers.image.revision=${{ github.sha }}
61+
org.opencontainers.image.created=${{ github.run_id }}
62+
org.opencontainers.image.version=${{ steps.vars.outputs.tag }}
63+
#platforms: linux/amd64,linux/arm64,linux/arm/v7

0 commit comments

Comments
 (0)