Skip to content

Build and push images #4

Build and push images

Build and push images #4

Workflow file for this run

name: Build and push images
on:
workflow_dispatch:
inputs:
gitRef:
description: Commit, tag or branch name to deploy
required: true
type: string
default: main
noPushToRegistry:
description: Build only, skip pushing to registry
required: true
type: boolean
default: false
# push:
# branches:
# - main
# schedule:
# - cron: '0 3 * * *'
jobs:
build_and_push:
name: Build ruby_${{ matrix.version }} images and push to GHCR
runs-on: ubuntu-22.04
strategy:
matrix:
version: ['3_2', '3_3']
permissions:
packages: write
steps:
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
ref: ${{ inputs.gitRef }}
show-progress: false
token: ${{ secrets.PUBLISHING_PLATFORM_CI_GITHUB_API_TOKEN }}
- name: Build images (without pushing to registry)
if: ${{ inputs.noPushToRegistry }}
env:
DRY_RUN: "1"
run: ./build.sh ${{ matrix.version }}
- name: Build and push images
if: ${{ !inputs.noPushToRegistry }}
run: ./build.sh ${{ matrix.version }}