ruby/ruby-docker-images/nightly #511
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
name: ruby/ruby-docker-images/nightly | |
on: | |
schedule: | |
- cron: '0 */12 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [noble, jammy, focal] | |
debug: ['', '-debug'] | |
dev: ['', '-dev'] | |
runs-on: ubuntu-latest | |
env: | |
nightly: true | |
push: true | |
ubuntu_version: ${{ matrix.os }} | |
ruby_version: master | |
image_version_suffix: ${{ matrix.debug }} | |
tag_suffix: '' | |
push_tags: '' | |
dev_suffix: ${{ matrix.dev }} | |
optflags: '' | |
cppflags: '' | |
debugflags: '' | |
steps: | |
- uses: actions/[email protected] | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USER }} | |
password: ${{ secrets.GHCR_ACCESS_TOKEN }} | |
- run: | | |
if [ "${{ env.dev_suffix }}" = "-dev" ]; then | |
echo "target=development" >> $GITHUB_ENV | |
else | |
echo "target=ruby" >> $GITHUB_ENV | |
fi | |
- run: | | |
if [ "${{ env.image_version_suffix }}" = "-debug" ]; then | |
echo "cppflags=-DENABLE_PATH_CHECK=0 -DRUBY_DEBUG=1" >> $GITHUB_ENV | |
echo "optflags=-O3 -fno-inline" >> $GITHUB_ENV | |
fi | |
- name: Build docker image | |
run: |- | |
rake docker:build ruby_version=${{ env.ruby_version }} \ | |
ubuntu_version=${{ env.ubuntu_version }} \ | |
image_version_suffix=${{ env.image_version_suffix }}${{ env.dev_suffix }} \ | |
nightly=${{ env.nightly }} \ | |
tag_suffix=${{ env.tag_suffix }} \ | |
target=${{ env.target }} \ | |
latest_tag=${{ env.latest_tag }} \ | |
arch=linux/amd64 | |
shell: bash | |
- name: List images | |
run: docker images | |
shell: bash | |
- name: Push docker image to rubylang | |
if: ${{ env.push }} | |
run: |- | |
rake docker:push ruby_version=${{ env.ruby_version }} \ | |
ubuntu_version=${{ env.ubuntu_version }} \ | |
image_version_suffix=${{ env.image_version_suffix }}${{ env.dev_suffix }} \ | |
nightly=${{ env.nightly }} \ | |
tag_suffix=${{ env.tag_suffix }} \ | |
latest_tag=false \ | |
registry_name=rubylang | |
shell: bash | |
- name: Push docker image to ghcr.io/ruby | |
if: ${{ env.push }} | |
run: |- | |
rake docker:push ruby_version=${{ env.ruby_version }} \ | |
ubuntu_version=${{ env.ubuntu_version }} \ | |
image_version_suffix=${{ env.image_version_suffix }}${{ env.dev_suffix }} \ | |
nightly=${{ env.nightly }} \ | |
tag_suffix=${{ env.tag_suffix }} \ | |
latest_tag=false \ | |
registry_name=ghcr.io/ruby | |
shell: bash | |
- name: Push the same image without the ubuntu version | |
if: matrix.os == 'noble' | |
run: |- | |
docker tag rubylang/ruby:${{ env.ruby_version }}${{ env.image_version_suffix }}${{ env.dev_suffix }}-${{ env.ubuntu_version }} rubylang/ruby:${{ env.ruby_version }}${{ env.image_version_suffix }}${{ env.dev_suffix }} | |
docker push rubylang/ruby:${{ env.ruby_version }}${{ env.image_version_suffix }}${{ env.dev_suffix }} | |
docker tag rubylang/ruby:${{ env.ruby_version }}${{ env.image_version_suffix }}${{ env.dev_suffix }} ghcr.io/ruby/ruby:${{ env.ruby_version }}${{ env.image_version_suffix }}${{ env.dev_suffix }} | |
docker push ghcr.io/ruby/ruby:${{ env.ruby_version }}${{ env.image_version_suffix }}${{ env.dev_suffix }} | |
shell: bash | |
- uses: ruby/[email protected] | |
with: | |
payload: | | |
{ | |
"attachments": [{ | |
"text": "${{ job.status }}: ${{ matrix.os }} ${{ matrix.debug }} ${{ matrix.dev }} <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>", | |
"color": "danger" | |
}] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
if: failure() |