ci: set DOCKER_CONFIG in step env (runner context unavailable on job env)
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
parent
58823d7187
commit
28cdb33e57
16
.github/workflows/publish-server-image.yml
vendored
16
.github/workflows/publish-server-image.yml
vendored
@ -186,14 +186,16 @@ jobs:
|
|||||||
context: infra/sandboxes/computer
|
context: infra/sandboxes/computer
|
||||||
- arch: amd64
|
- arch: amd64
|
||||||
runner: [self-hosted, evoo-ci, Linux]
|
runner: [self-hosted, evoo-ci, Linux]
|
||||||
env:
|
|
||||||
DOCKER_CONFIG: ${{ runner.temp }}/docker-config
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Prepare isolated Docker config directory
|
- name: Prepare isolated Docker config directory
|
||||||
run: mkdir -p "$DOCKER_CONFIG"
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
cfg="${RUNNER_TEMP}/docker-config"
|
||||||
|
mkdir -p "$cfg"
|
||||||
|
echo "DOCKER_CONFIG=${cfg}" >> "$GITHUB_ENV"
|
||||||
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||||
@ -257,11 +259,13 @@ jobs:
|
|||||||
- name: app
|
- name: app
|
||||||
- name: updater
|
- name: updater
|
||||||
- name: computer
|
- name: computer
|
||||||
env:
|
|
||||||
DOCKER_CONFIG: ${{ runner.temp }}/docker-config
|
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare isolated Docker config directory
|
- name: Prepare isolated Docker config directory
|
||||||
run: mkdir -p "$DOCKER_CONFIG"
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
cfg="${RUNNER_TEMP}/docker-config"
|
||||||
|
mkdir -p "$cfg"
|
||||||
|
echo "DOCKER_CONFIG=${cfg}" >> "$GITHUB_ENV"
|
||||||
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
||||||
- name: Log in to GHCR
|
- name: Log in to GHCR
|
||||||
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
||||||
|
|||||||
@ -63,7 +63,7 @@ describe("server image publish workflow", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("isolates Docker registry auth per job and deletes handoff tags without imagetools rm", () => {
|
it("isolates Docker registry auth per job and deletes handoff tags without imagetools rm", () => {
|
||||||
expect(workflowText).toContain("DOCKER_CONFIG: ${{ runner.temp }}/docker-config");
|
expect(workflowText).toContain('echo "DOCKER_CONFIG=${cfg}" >> "$GITHUB_ENV"');
|
||||||
expect(workflowText).toContain("Prepare isolated Docker config directory");
|
expect(workflowText).toContain("Prepare isolated Docker config directory");
|
||||||
expect(workflowText).not.toContain("imagetools rm");
|
expect(workflowText).not.toContain("imagetools rm");
|
||||||
expect(workflowText).toContain("Delete CI handoff tags");
|
expect(workflowText).toContain("Delete CI handoff tags");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user