diff --git a/.gitea/workflows/publish-images.yml b/.gitea/workflows/publish-images.yml index ccb1b36..053f9b4 100644 --- a/.gitea/workflows/publish-images.yml +++ b/.gitea/workflows/publish-images.yml @@ -17,10 +17,14 @@ on: jobs: publish-images: name: publish-images - runs-on: [self-hosted, vm] + runs-on: self-hosted timeout-minutes: 45 permissions: contents: read + container: + image: docker.io/gitea/runner-images:ubuntu-latest@sha256:fd911d7417bfbf0f454530e447da95b58001e1df41bbc5e1a8dd35d432575aae + volumes: + - /run/spire/agent-sockets:/run/spire/agent-sockets:ro env: PUSH_REGISTRY: zot-push.ad.ddupan.top PULL_REGISTRY: zot.ad.ddupan.top @@ -41,6 +45,19 @@ jobs: apt-get install --yes --no-install-recommends shellcheck shellcheck scripts/* + - name: Fetch pinned SPIRE CLI + shell: bash + run: | + set -euo pipefail + archive=/tmp/spire.tar.gz + curl --fail --location --silent --show-error \ + --output "$archive" \ + https://github.com/spiffe/spire/releases/download/v1.15.3/spire-1.15.3-linux-amd64-musl.tar.gz + printf '%s %s\n' \ + ca1a4d1155317bdd2afc7f36663828a10410c7c840e54725b90b4064b0a301c7 \ + "$archive" | sha256sum --check --status + tar -xzf "$archive" -C /tmp spire-1.15.3/bin/spire-agent + - name: Build and publish shell: bash run: | @@ -58,7 +75,7 @@ jobs: trap cleanup EXIT export DOCKER_CONFIG="$docker_config" - /opt/spire/bin/spire-agent api fetch jwt \ + /tmp/spire-1.15.3/bin/spire-agent api fetch jwt \ -audience zot \ -socketPath "$SPIRE_AGENT_SOCKET" \ -output json >"$jwt_file"