Skip to content

Commit b2f5f5a

Browse files
authored
Merge pull request #130 from rake-compiler/flavorjones-snapshot-generic-linux-image
ci: generate a generic linux snapshot image
2 parents 3f71871 + 4ed8ec1 commit b2f5f5a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/publish-images.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,20 @@ jobs:
4141
with:
4242
ruby-version: "3.1"
4343
bundler-cache: true
44-
- id: rcd_config
44+
- name: Generate docker image names
45+
id: rcd_config
4546
run: |
4647
bundle exec ruby -e ' \
4748
require "rake_compiler_dock"; \
4849
print "image_name="; \
4950
puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}})); \
5051
print "snapshot_name="; \
5152
puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)); \
53+
if %q(${{matrix.platform}}).end_with?("-gnu"); \
54+
print "generic_linux_snapshot_name="; \
55+
puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)).chomp("-gnu"); \
56+
end \
5257
' | tee -a $GITHUB_OUTPUT
53-
5458
- name: Build docker image
5559
env:
5660
RCD_DOCKER_BUILD: docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load
@@ -65,7 +69,13 @@ jobs:
6569
registry: ghcr.io
6670
username: ${{github.actor}}
6771
password: ${{secrets.GITHUB_TOKEN}}
68-
- run: |
72+
- name: Push the docker image
73+
run: |
6974
docker images
7075
docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.snapshot_name}}
7176
docker push ${{steps.rcd_config.outputs.snapshot_name}}
77+
- name: Push a generic linux image
78+
if: ${{ steps.rcd_config.outputs.generic_linux_snapshot_name }}
79+
run: |
80+
docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.generic_linux_snapshot_name}}
81+
docker push ${{steps.rcd_config.outputs.generic_linux_snapshot_name}}

0 commit comments

Comments
 (0)