-
-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (65 loc) · 2.1 KB
/
docker-cli.yml
File metadata and controls
75 lines (65 loc) · 2.1 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
# Trinity CLI - Docker Build & Push to GHCR
name: Build & Push Trinity CLI
on:
push:
branches: [main]
paths:
- 'src/tri/**'
- 'src/sacred/**'
- 'build.zig'
- 'build.zig.zon'
- 'deploy/Dockerfile.tri'
workflow_dispatch:
jobs:
build-push:
name: Build & Push Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Build TRI CLI
run: |
zig build -Doptimize=ReleaseFast
ls -la zig-out/bin/tri
mkdir -p docker-artifacts
cp zig-out/bin/tri docker-artifacts/tri
chmod +x docker-artifacts/tri
file docker-artifacts/tri
- name: Create Dockerfile
run: |
cat > Dockerfile.ci << 'EOF'
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
COPY docker-artifacts/tri /usr/local/bin/tri
RUN chmod +x /usr/local/bin/tri && tri --version
LABEL org.opencontainers.image.title="Trinity CLI"
LABEL org.opencontainers.image.description="Sacred Intelligence CLI — Trinity"
LABEL org.opencontainers.image.source="https://github.com/gHashTag/trinity"
LABEL org.opencontainers.image.licenses="MIT"
WORKDIR /workspace
ENTRYPOINT ["tri"]
CMD ["--version"]
EOF
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.ci
platforms: linux/amd64
push: true
tags: |
ghcr.io/ghashtag/trinity:latest
ghcr.io/ghashtag/trinity:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max