Fix docker image signing v2 (#32956)
* Tweak cd.yaml workflow * Tweak cd.yaml workflow * Iterate * Iterate * Iterate * Iterate * Remove debug
This commit is contained in:
@@ -21,11 +21,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
||||||
with:
|
with:
|
||||||
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
|
|
||||||
fetch-depth: 0
|
|
||||||
# reduce the size of the checkout with tree filtering,
|
|
||||||
# see https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
|
|
||||||
filter: tree:0
|
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Install Cosign
|
- name: Install Cosign
|
||||||
@@ -54,17 +49,20 @@ jobs:
|
|||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- run: pnpm nx run-many -t docker:build
|
- run: pnpm nx run-many --nxBail -t docker:build
|
||||||
|
id: build
|
||||||
env:
|
env:
|
||||||
INPUT_PUSH: true
|
INPUT_PUSH: true
|
||||||
|
INPUT_LOAD: false
|
||||||
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
INPUT_BUILDER: ${{ steps.builder.outputs.name }}
|
INPUT_BUILDER: ${{ steps.builder.outputs.name }}
|
||||||
|
|
||||||
- name: Sign the images with GitHub OIDC token
|
- name: Sign the images with GitHub OIDC token
|
||||||
env:
|
|
||||||
PATTERN: "^ghcr.io/element-hq/element-web*"
|
|
||||||
run: |
|
run: |
|
||||||
docker image ls --digests --format '{{.Repository}}@{{.Digest}}' | grep "$PATTERN" | while read -r TARGET; do
|
shopt -s globstar
|
||||||
|
|
||||||
|
for FILE in ./node_modules/.cache/nx-container/**/metadata; do
|
||||||
|
TARGET=$(jq -r '.["image.name"] + "@" + .["containerimage.digest"]' "$FILE")
|
||||||
echo "Signing $TARGET..."
|
echo "Signing $TARGET..."
|
||||||
cosign sign --yes "$TARGET"
|
cosign sign --yes "$TARGET"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -5,15 +5,14 @@
|
|||||||
"targets": {
|
"targets": {
|
||||||
"docker:build": {
|
"docker:build": {
|
||||||
"executor": "@nx-tools/nx-container:build",
|
"executor": "@nx-tools/nx-container:build",
|
||||||
"dependsOn": ["docker:prebuild"],
|
|
||||||
"options": {
|
"options": {
|
||||||
"load": true,
|
"load": true,
|
||||||
"engine": "docker",
|
"engine": "docker",
|
||||||
"platforms": ["linux/amd64", "linux/arm64"],
|
"platforms": ["linux/amd64", "linux/arm64"],
|
||||||
"provenance": "true",
|
"provenance": "true",
|
||||||
"sbom": true,
|
"sbom": true,
|
||||||
"context": "apps/desktop",
|
"context": "{projectRoot}",
|
||||||
"file": "apps/desktop/dockerbuild/Dockerfile",
|
"file": "{projectRoot}/dockerbuild/Dockerfile",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"images": ["ghcr.io/element-hq/element-web/desktop-build-env"],
|
"images": ["ghcr.io/element-hq/element-web/desktop-build-env"],
|
||||||
"tags": ["type=ref,event=branch"]
|
"tags": ["type=ref,event=branch"]
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
"provenance": "true",
|
"provenance": "true",
|
||||||
"sbom": true,
|
"sbom": true,
|
||||||
"build-args": ["PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION"],
|
"build-args": ["PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION"],
|
||||||
"context": "packages/playwright-common",
|
"context": "{projectRoot}",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"images": ["ghcr.io/element-hq/element-web/playwright-server"],
|
"images": ["ghcr.io/element-hq/element-web/playwright-server"],
|
||||||
"tags": ["type=raw,enable={{is_default_branch}},value=$PLAYWRIGHT_VERSION"]
|
"tags": ["type=ref,event=branch", "type=raw,enable={{is_default_branch}},value=$PLAYWRIGHT_VERSION"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user