Repository navigation
98 lines (87 loc) · 3.51 KB
/
Copy pathlws-container.yml
File metadata and controls
98 lines (87 loc) · 3.51 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# sq-lmz40 — release the native Solid/LWS image independently of sparq-server.
name: LWS container release
on:
push:
tags:
- "v*"
# Publish the LWS image on demand WITHOUT cutting a full `v*` release
# (that tag also fires release.yml). A manual run tags only `:latest` (the semver
# tags below require a git tag) — exactly what the deploy templates + demo reference.
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
name: smoke + scan + publish LWS container
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out release tag
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Buildx for native gate
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
# Gate the loadable native artifact before registry login or any multi-arch push.
- name: Build native amd64 image for smoke and scan
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: crates/sparq-lws-core/Dockerfile
load: true
push: false
platforms: linux/amd64
tags: sparq-lws-core:smoke
cache-from: type=gha,scope=sparq-lws-core
cache-to: type=gha,mode=max,scope=sparq-lws-core
provenance: false
sbom: false
- name: Smoke native image (health, fail-closed mutation, non-root)
env:
LWS_CONTAINER_SKIP_BUILD: "1"
run: crates/sparq-lws-core/tests/container-smoke.sh sparq-lws-core:smoke 3000
- name: Scan native image (fail on fixable HIGH or CRITICAL)
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
image-ref: sparq-lws-core:smoke
scan-type: image
format: table
exit-code: "1"
ignore-unfixed: true
severity: HIGH,CRITICAL
vuln-type: os,library
trivyignores: .trivyignore
# Only after the native artifact passes smoke + vulnerability gates do we
# enable emulation, authenticate, and publish the multi-arch image index.
- name: Set up QEMU for arm64
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
with:
platforms: arm64
- name: Log in to ghcr.io
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate stable release tags and OCI labels
id: meta
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
with:
images: ghcr.io/sparq-org/sparq-lws-core
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- name: Publish amd64 + arm64 image index
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
with:
context: .
file: crates/sparq-lws-core/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=sparq-lws-core
cache-to: type=gha,mode=max,scope=sparq-lws-core
provenance: mode=max
sbom: true