-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a workflow for publishing new ruby versions
When new ruby versions are released, we want to publish new versions of the existing images for those ruby versions, rather than cut a new version of the image. So let's create a manually GH workflow that publishes a list of ruby versions for a list of image tags.
- Loading branch information
1 parent
6fd5cca
commit ddaf951
Showing
5 changed files
with
148 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build and Publish Image | ||
description: Steps for building an image for a specific ruby version | ||
inputs: | ||
ruby_version: | ||
required: true | ||
image_tag: | ||
required: true | ||
gh_token: | ||
required: true | ||
repository_owner: | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout (GitHub) | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.image_tag }} | ||
|
||
- name: Set up QEMU for multi-architecture builds | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Set Image version env variable | ||
run: echo "IMAGE_VERSION=$(echo ${{ inputs.image_tag }} | tr -d ruby-)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.repository_owner }} | ||
password: ${{ inputs.gh_token }} | ||
|
||
- name: Pre-build Dev Container Image | ||
uses: devcontainers/[email protected] | ||
env: | ||
RUBY_VERSION: ${{ inputs.ruby_version }} | ||
BUILDX_NO_DEFAULT_ATTESTATIONS: true | ||
with: | ||
imageName: ghcr.io/rails/devcontainer/images/ruby | ||
imageTag: ${{ env.IMAGE_VERSION }}-${{ inputs.ruby_version }},${{ inputs.ruby_version }} | ||
subFolder: images/ruby | ||
push: always | ||
platform: linux/amd64,linux/arm64 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and Publish Images | ||
|
||
on: | ||
push: | ||
tags: [ 'ruby-*.*.*' ] | ||
|
||
jobs: | ||
build: | ||
name: Build Images | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
RUBY_VERSION: | ||
- 3.3.0 | ||
- 3.2.3 | ||
- 3.2.2 | ||
- 3.2.1 | ||
- 3.2.0 | ||
- 3.1.4 | ||
- 3.1.3 | ||
- 3.1.2 | ||
- 3.1.1 | ||
- 3.1.0 | ||
- 3.0.6 | ||
- 3.0.5 | ||
- 3.0.4 | ||
- 3.0.3 | ||
- 3.0.2 | ||
- 3.0.1 | ||
- 3.0.0 | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout (GitHub) | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and Publish Image | ||
uses: ./.github/actions/build-and-publish-image.yml | ||
with: | ||
ruby_version: ${{ matrix.RUBY_VERSION }} | ||
image_tag: ${{ github.ref_name }} | ||
gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository_owner: ${{ github.repository_owner }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Build and Publish New Ruby Versions | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
ruby_versions: | ||
type: string | ||
required: true | ||
description: List of ruby versions to build. Should be an array ["3.3.1","3.2.4"] | ||
image_versions: | ||
type: string | ||
required: true | ||
description: List of image versions to build. Should be an array ["ruby-0.3.0"] | ||
|
||
jobs: | ||
build: | ||
name: Build Images | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
RUBY_VERSION: ${{ fromJSON(github.event.inputs.ruby_versions)}} | ||
IMAGE_VERSION: ${{ fromJSON(github.event.inputs.image_versions)}} | ||
|
||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout (GitHub) | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build and Publish Image | ||
uses: ./.github/actions/build-and-publish-image.yml | ||
with: | ||
ruby_version: ${{ matrix.RUBY_VERSION }} | ||
image_tag: ${{ matrix.IMAGE_VERSION }} | ||
gh_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository_owner: ${{ github.repository_owner }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters