diff --git a/.github/actions/build-and-publish-image/action.yml b/.github/actions/build-and-publish-image/action.yml index 07fd369..e969660 100644 --- a/.github/actions/build-and-publish-image/action.yml +++ b/.github/actions/build-and-publish-image/action.yml @@ -29,10 +29,6 @@ runs: 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@v3 with: @@ -47,7 +43,7 @@ runs: BUILDX_NO_DEFAULT_ATTESTATIONS: true with: imageName: ghcr.io/rails/devcontainer/images/ruby - imageTag: ${{ env.IMAGE_VERSION }}-${{ inputs.ruby_version }},${{ inputs.ruby_version }} + imageTag: ${{ inputs.image_tag }} subFolder: images/ruby push: always platform: linux/amd64,linux/arm64 diff --git a/.github/workflows/publish-new-image-version.yaml b/.github/workflows/publish-new-image-version.yaml index 057f64b..30c0209 100644 --- a/.github/workflows/publish-new-image-version.yaml +++ b/.github/workflows/publish-new-image-version.yaml @@ -24,10 +24,14 @@ jobs: - name: Checkout (GitHub) uses: actions/checkout@v4 + - name: Set Image version env variable + run: echo "IMAGE_VERSION=$(echo ${{ github.ref_name }} | tr -d ruby-)" >> $GITHUB_ENV + shell: bash + - name: Build and Publish Image uses: ./.github/actions/build-and-publish-image with: ruby_version: ${{ matrix.RUBY_VERSION }} - image_tag: ${{ github.ref_name }} + image_tag: ${{ env.IMAGE_VERSION }}-${{ matrix.RUBY_VERSION}},${{ matrix.RUBY_VERSION}} gh_token: ${{ secrets.GITHUB_TOKEN }} repository_owner: ${{ github.repository_owner }} diff --git a/.github/workflows/publish-new-ruby-versions.yml b/.github/workflows/publish-new-ruby-versions.yml index 6bfd1a9..78047cc 100644 --- a/.github/workflows/publish-new-ruby-versions.yml +++ b/.github/workflows/publish-new-ruby-versions.yml @@ -7,10 +7,10 @@ on: type: string required: true description: List of ruby versions to build. Should be an array ["3.3.1","3.2.4"] - image_versions: + image_tag: type: string required: true - description: List of image versions to build. Should be an array ["ruby-0.3.0"] + description: List of image tags to build. Should be an array ["ruby-0.3.0"] jobs: build: @@ -30,10 +30,14 @@ jobs: - name: Checkout (GitHub) uses: actions/checkout@v4 + - name: Set Image version env variable + run: echo "IMAGE_VERSION=$(echo ${{ inputs.image_tag }} | tr -d ruby-)" >> $GITHUB_ENV + shell: bash + - name: Build and Publish Image uses: ./.github/actions/build-and-publish-image with: ruby_version: ${{ matrix.RUBY_VERSION }} - image_tag: ${{ matrix.IMAGE_VERSION }} + image_tag: ${{ env.IMAGE_VERSION }}-${{ matrix.RUBY_VERSION }} gh_token: ${{ secrets.GITHUB_TOKEN }} repository_owner: ${{ github.repository_owner }}