Skip to content

Commit

Permalink
ci: generate a generic linux snapshot image
Browse files Browse the repository at this point in the history
This change pushes a copy of `*-linux-gnu` as `*-linux`.

Currently the snapshots are only pushing `*-linux-gnu` and
`*-linux-musl` images.
  • Loading branch information
flavorjones committed Dec 12, 2024
1 parent 3f71871 commit 4ed8ec1
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/publish-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@ jobs:
with:
ruby-version: "3.1"
bundler-cache: true
- id: rcd_config
- name: Generate docker image names
id: rcd_config
run: |
bundle exec ruby -e ' \
require "rake_compiler_dock"; \
print "image_name="; \
puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}})); \
print "snapshot_name="; \
puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)); \
if %q(${{matrix.platform}}).end_with?("-gnu"); \
print "generic_linux_snapshot_name="; \
puts RakeCompilerDock::Starter.container_image_name(:platform => %q(${{matrix.platform}}), :version => %q(snapshot)).chomp("-gnu"); \
end \
' | tee -a $GITHUB_OUTPUT
- name: Build docker image
env:
RCD_DOCKER_BUILD: docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load
Expand All @@ -65,7 +69,13 @@ jobs:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- run: |
- name: Push the docker image
run: |
docker images
docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.snapshot_name}}
docker push ${{steps.rcd_config.outputs.snapshot_name}}
- name: Push a generic linux image
if: ${{ steps.rcd_config.outputs.generic_linux_snapshot_name }}
run: |
docker tag ${{steps.rcd_config.outputs.image_name}} ${{steps.rcd_config.outputs.generic_linux_snapshot_name}}
docker push ${{steps.rcd_config.outputs.generic_linux_snapshot_name}}

0 comments on commit 4ed8ec1

Please sign in to comment.