Skip to content

Commit d9032c4

Browse files
Merge pull request #603 from RomanNikitenko/fix-publishing-pr-images
Fix publishing PR images
2 parents 42cae06 + c9b5ea0 commit d9032c4

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

.github/workflows/pull-request-check-publish.yml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ jobs:
2121
name: publish image from the pull request
2222
runs-on: ubuntu-22.04
2323
steps:
24+
- name: Free up disk space
25+
run: |
26+
df -h
27+
rm -rf /opt/hostedtoolcache
28+
df -h
29+
30+
- name: Login to Quay.io
31+
uses: docker/login-action@v3
32+
with:
33+
registry: quay.io
34+
username: ${{ secrets.QUAY_PULL_REQUESTS_USERNAME }}
35+
password: ${{ secrets.QUAY_PULL_REQUESTS_PASSWORD }}
2436

2537
- name: Download Pull Request Number artifact
2638
uses: actions/download-artifact@v4
@@ -55,40 +67,53 @@ jobs:
5567
- name: List downloaded files
5668
run: |
5769
ls -lahR
58-
59-
- name: Load Docker images
70+
- name: Load che-code-amd64 image
6071
run: |
6172
docker load -i che-code-amd64.tgz
62-
docker load -i che-code-arm64.tgz
63-
docker load -i che-dev.tgz
64-
65-
- name: Login to Quay.io
66-
uses: docker/login-action@v3
67-
with:
68-
registry: quay.io
69-
username: ${{ secrets.QUAY_PULL_REQUESTS_USERNAME }}
70-
password: ${{ secrets.QUAY_PULL_REQUESTS_PASSWORD }}
7173
7274
- name: Push che-code-amd64 docker image
7375
run: |
7476
export IMAGE=quay.io/che-incubator-pull-requests/che-code:pr-${{env._PR_NUMBER}}-amd64
7577
docker tag che-code-amd64 ${IMAGE}
7678
docker push ${IMAGE}
7779
echo "_CHE_CODE_AMD64_IMAGE=${IMAGE}" >> $GITHUB_ENV
80+
81+
- name: Remove che-code-amd64 and prune
82+
run: |
83+
docker image rm che-code-amd64 || true
84+
docker system prune -af
85+
86+
- name: Load che-code-arm64 image
87+
run: |
88+
docker load -i che-code-arm64.tgz
7889
7990
- name: Push che-code-arm64 docker image
8091
run: |
8192
export IMAGE=quay.io/che-incubator-pull-requests/che-code:pr-${{env._PR_NUMBER}}-arm64
8293
docker tag che-code-arm64 ${IMAGE}
8394
docker push ${IMAGE}
8495
echo "_CHE_CODE_ARM64_IMAGE=${IMAGE}" >> $GITHUB_ENV
96+
97+
- name: Remove che-code-arm64 and prune
98+
run: |
99+
docker image rm che-code-arm64 || true
100+
docker system prune -af
101+
102+
- name: Load che-dev image
103+
run: |
104+
docker load -i che-dev.tgz
85105
86106
- name: Push che-dev docker image
87107
run: |
88108
export IMAGE=quay.io/che-incubator-pull-requests/che-code-dev:pr-${{env._PR_NUMBER}}-dev-amd64
89109
docker tag che-dev ${IMAGE}
90110
docker push ${IMAGE}
91111
echo "_CHE_DEV_IMAGE=${IMAGE}" >> $GITHUB_ENV
112+
113+
- name: Remove che-dev and prune
114+
run: |
115+
docker image rm che-dev || true
116+
docker system prune -af
92117
93118
- name: 'Comment PR'
94119
uses: actions/github-script@v7

0 commit comments

Comments
 (0)