+52
.tangled/workflows/build-images.yml
+52
.tangled/workflows/build-images.yml
···
1
+
when:
2
+
- event: ["push"]
3
+
branch: master
4
+
5
+
engine: nixery
6
+
7
+
dependencies:
8
+
nixpkgs:
9
+
- kaniko
10
+
- regctl
11
+
12
+
environment:
13
+
GHCR_USER: "zenfyrdev"
14
+
HOME: /root
15
+
16
+
steps:
17
+
- name: create auth configs
18
+
command: |
19
+
mkdir $HOME
20
+
mkdir $HOME/.docker $HOME/.regctl
21
+
22
+
cat > $HOME/.docker/config.json <<EOF
23
+
{"auths": {"ghcr.io": {"auth": "$(echo -n "$GHCR_USER:$GHCR_PAT" | base64 -w0)"}}}
24
+
EOF
25
+
26
+
cat > $HOME/.regctl/config.json <<EOF
27
+
{"hosts": {"ghcr.io": {"user": "$GHCR_USER","pass": "$GHCR_PAT"}}}
28
+
EOF
29
+
30
+
- name: build amd64
31
+
command: |
32
+
executor \
33
+
--context=dir://. \
34
+
--dockerfile=Containerfile \
35
+
--verbosity=info \
36
+
--destination=ghcr.io/$GHCR_USER/xpost:amd64-latest \
37
+
--custom-platform=linux/amd64
38
+
39
+
- name: build arm64
40
+
command: |
41
+
executor \
42
+
--context=dir://. \
43
+
--dockerfile=Containerfile \
44
+
--verbosity=info \
45
+
--destination=ghcr.io/$GHCR_USER/xpost:arm64-latest \
46
+
--custom-platform=linux/arm64
47
+
48
+
- name: tag latest artifact
49
+
command: |
50
+
regctl index create ghcr.io/$GHCR_USER/xpost:latest \
51
+
--ref ghcr.io/$GHCR_USER/xpost:amd64-latest --platform linux/amd64 \
52
+
--ref ghcr.io/$GHCR_USER/xpost:arm64-latest --platform linux/arm64