Skip to content

Commit df6ab87

Browse files
authored
Merge pull request #49 from fccview/develop
Lift off!!!
2 parents e2e9596 + feeb56e commit df6ab87

143 files changed

Lines changed: 10618 additions & 1811 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docker-build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Reusable Docker Build Logic
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
platform: { required: true, type: string }
7+
suffix: { required: true, type: string }
8+
runner: { required: true, type: string }
9+
secrets:
10+
token: { required: true }
11+
12+
jobs:
13+
build:
14+
runs-on: ${{ inputs.runner }}
15+
permissions: { contents: read, packages: write }
16+
steps:
17+
- { name: Checkout repository, uses: actions/checkout@v4 }
18+
19+
- name: "Prepare repository name in lowercase"
20+
id: repo
21+
run: echo "name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
22+
23+
- { name: Set up QEMU, uses: docker/setup-qemu-action@v3 }
24+
- { name: Set up Docker Buildx, uses: docker/setup-buildx-action@v3 }
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.token }}
31+
32+
- name: Extract metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: |
37+
ghcr.io/${{ steps.repo.outputs.name }}
38+
tags: |
39+
type=ref,event=branch,suffix=${{ inputs.suffix }}
40+
type=ref,event=tag,suffix=${{ inputs.suffix }}
41+
type=raw,value=latest,suffix=${{ inputs.suffix }}
42+
43+
- name: Build and push Docker image
44+
uses: docker/build-push-action@v5
45+
with:
46+
context: .
47+
platforms: ${{ inputs.platform }}
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
Lines changed: 102 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,69 @@
1-
name: Docker
1+
name: Build and Publish Multi-Platform Docker Image
22

33
on:
44
push:
5-
branches: ["main", "legacy", "feature/*"]
5+
branches: ["main", "develop"]
66
tags: ["*"]
7-
pull_request:
8-
branches: ["main"]
9-
10-
env:
11-
REGISTRY: ghcr.io
12-
IMAGE_NAME: ${{ github.repository }}
137

148
jobs:
15-
build:
9+
build-amd64:
1610
runs-on: ubuntu-latest
1711
permissions:
1812
contents: read
1913
packages: write
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Prepare repository name in lowercase
19+
id: repo
20+
run: echo "name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ghcr.io
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Extract metadata
33+
id: meta
34+
uses: docker/metadata-action@v5
35+
with:
36+
images: |
37+
ghcr.io/${{ steps.repo.outputs.name }}
38+
tags: |
39+
type=ref,event=branch,suffix=-amd64
40+
type=ref,event=tag,suffix=-amd64
41+
type=raw,value=latest,suffix=-amd64,enable=${{ startsWith(github.ref, 'refs/tags/') }}
42+
43+
- name: Build and push AMD64 Docker image
44+
uses: docker/build-push-action@v5
45+
with:
46+
context: .
47+
platforms: linux/amd64
48+
push: true
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
2053

54+
build-arm64:
55+
runs-on: ubuntu-22.04-arm
56+
permissions:
57+
contents: read
58+
packages: write
2159
steps:
2260
- name: Checkout repository
2361
uses: actions/checkout@v4
2462

63+
- name: Prepare repository name in lowercase
64+
id: repo
65+
run: echo "name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
66+
2567
- name: Set up QEMU
2668
uses: docker/setup-qemu-action@v3
2769

@@ -31,27 +73,68 @@ jobs:
3173
- name: Log in to the Container registry
3274
uses: docker/login-action@v3
3375
with:
34-
registry: ${{ env.REGISTRY }}
76+
registry: ghcr.io
3577
username: ${{ github.actor }}
3678
password: ${{ secrets.GITHUB_TOKEN }}
3779

38-
- name: Extract metadata (tags, labels) for Docker
80+
- name: Extract metadata
3981
id: meta
4082
uses: docker/metadata-action@v5
4183
with:
42-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
84+
images: |
85+
ghcr.io/${{ steps.repo.outputs.name }}
4386
tags: |
44-
type=ref,event=branch
45-
type=ref,event=pr
46-
type=semver,pattern={{version}}
47-
type=semver,pattern={{major}}.{{minor}}
48-
type=sha
87+
type=ref,event=branch,suffix=-arm64
88+
type=ref,event=tag,suffix=-arm64
89+
type=raw,value=latest,suffix=-arm64,enable=${{ startsWith(github.ref, 'refs/tags/') }}
4990
50-
- name: Build and push Docker image
91+
- name: Build and push ARM64 Docker image
5192
uses: docker/build-push-action@v5
5293
with:
5394
context: .
54-
platforms: linux/amd64,linux/arm64
95+
platforms: linux/arm64
5596
push: true
5697
tags: ${{ steps.meta.outputs.tags }}
5798
labels: ${{ steps.meta.outputs.labels }}
99+
cache-from: type=gha
100+
cache-to: type=gha,mode=max
101+
102+
manifest:
103+
needs: [build-amd64, build-arm64]
104+
runs-on: ubuntu-latest
105+
permissions:
106+
contents: read
107+
packages: write
108+
109+
steps:
110+
- name: Prepare repository name in lowercase
111+
id: repo
112+
run: echo "name=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
113+
114+
- name: Log in to the Container registry
115+
uses: docker/login-action@v3
116+
with:
117+
registry: ghcr.io
118+
username: ${{ github.actor }}
119+
password: ${{ secrets.GITHUB_TOKEN }}
120+
121+
- name: Extract metadata for final manifest
122+
id: meta
123+
uses: docker/metadata-action@v5
124+
with:
125+
images: |
126+
ghcr.io/${{ steps.repo.outputs.name }}
127+
tags: |
128+
type=ref,event=branch
129+
type=ref,event=tag
130+
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
131+
132+
- name: Create and push manifest list
133+
run: |
134+
echo "${{ steps.meta.outputs.tags }}" | while read -r tag; do
135+
if [ -z "$tag" ]; then continue; fi
136+
echo "Creating manifest for ${tag}"
137+
docker buildx imagetools create --tag "${tag}" \
138+
"${tag}-amd64" \
139+
"${tag}-arm64"
140+
done

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ node_modules
1313
.cursorignore
1414
.idea
1515
tsconfig.tsbuildinfo
16-
docker-compose.test.yml
16+
docker-compose.test.yml
17+
/data

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ RUN apt-get update && apt-get install -y \
55
curl \
66
iputils-ping \
77
util-linux \
8+
ca-certificates \
9+
gnupg \
10+
lsb-release \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
14+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \
15+
&& apt-get update \
16+
&& apt-get install -y docker-ce-cli \
817
&& rm -rf /var/lib/apt/lists/*
918

1019
FROM base AS deps

0 commit comments

Comments
 (0)