Skip to content

Commit

Permalink
Merge pull request #13 from rails/run-image-workflow-on-tag-push
Browse files Browse the repository at this point in the history
Improve the workflow for publishing images
  • Loading branch information
andrewn617 authored Mar 27, 2024
2 parents 1a0ba7c + 7b79e93 commit 1fd391b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build-and-publish-images.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Build and Publish Images

on:
workflow_dispatch:
push:
tags: [ 'ruby-*.*.*' ]

jobs:
build:
Expand Down Expand Up @@ -45,6 +46,9 @@ jobs:
with:
platforms: linux/amd64,linux/arm64

- name: Set Image version env variable
run: echo "IMAGE_VERSION=$(echo ${{ github.ref_name }} | tr -d ruby-)" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
Expand All @@ -59,7 +63,7 @@ jobs:
BUILDX_NO_DEFAULT_ATTESTATIONS: true
with:
imageName: ghcr.io/rails/devcontainer/images/ruby
imageTag: 0.3.0-${{ matrix.RUBY_VERSION }},${{ matrix.RUBY_VERSION }}
imageTag: ${{ env.IMAGE_VERSION }}-${{ matrix.RUBY_VERSION }},${{ matrix.RUBY_VERSION }}
subFolder: images/ruby
push: always
platform: linux/amd64,linux/arm64

0 comments on commit 1fd391b

Please sign in to comment.