Skip to content

Commit 8f7dbc7

Browse files
committed
wip: pipeline to publish image snapshots
1 parent 358b63e commit 8f7dbc7

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

.github/workflows/publish-images.yml

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,55 @@ on:
77

88
jobs:
99
build:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
platform:
14+
# - x86-mingw32
15+
# - x64-mingw-ucrt
16+
# - x64-mingw32
17+
# - x86-linux
18+
- x86_64-linux
19+
# - x86_64-darwin
20+
# - arm64-darwin
21+
# - arm-linux
22+
# - aarch64-linux
23+
# - jruby
24+
runs-on: ubuntu-latest
25+
env:
26+
DOCKERHUB_USER: rake-compiler
1027
steps:
11-
- run: echo "this is a stub pipeline so that I can ship a working version in #84"
28+
- uses: actions/checkout@v3
29+
- name: Cache Docker layers
30+
uses: actions/cache@v3
31+
with:
32+
path: tmp/build-cache
33+
key: ${{ runner.os }}-${{ matrix.platform }}-buildx-${{ github.sha }}
34+
restore-keys: |
35+
${{ runner.os }}-${{ matrix.platform }}-buildx
36+
- uses: ruby/setup-ruby@v1
37+
with:
38+
ruby-version: "3.0"
39+
bundler-cache: true
40+
- id: rcd_image_version
41+
run: bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> $GITHUB_OUTPUT
42+
- name: Build docker image
43+
run: |
44+
docker buildx create --driver docker-container --use
45+
bundle exec rake build:${{ matrix.platform }} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new --load"
46+
- name: Move build cache and remove outdated layers
47+
run: |
48+
rm -rf tmp/build-cache
49+
mv tmp/build-cache-new tmp/build-cache
50+
- uses: docker/login-action@v2
51+
with:
52+
registry: ghcr.io
53+
username: ${{github.actor}}
54+
password: ${{secrets.GITHUB_TOKEN}}
55+
- run: |
56+
docker images
57+
docker tag \
58+
rake-compiler/rake-compiler-dock-mri-${{matrix.platform}}:${{steps.rcd_image_version.outputs.rcd_image_version}} \
59+
60+
ghcr.io/rake-compiler/rake-compiler-dock-snapshot:mri-${{matrix.platform}}
61+
docker push ghcr.io/rake-compiler/rake-compiler-dock-snapshot:mri-${{matrix.platform}}

0 commit comments

Comments
 (0)