Skip to content

Docker Build Release #1

Docker Build Release

Docker Build Release #1

Workflow file for this run

name: Docker Build Release
on:
workflow_dispatch:
schedule:
- cron: "0 1 * * *"
jobs:
extract-version:
name: Extract version
runs-on: warp-ubuntu-latest-x64-16x
outputs:
VERSION: ${{ steps.extract_version.outputs.VERSION }}
steps:
- name: Extract version
id: extract_version
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
else
VERSION="$(echo ${GITHUB_SHA} | cut -c1-7)"
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "| | |" >> $GITHUB_STEP_SUMMARY
echo "| ------------------- | ---------------------- |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_REF_TYPE\` | \`${GITHUB_REF_TYPE}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_REF_NAME\` | \`${GITHUB_REF_NAME}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_REF\` | \`${GITHUB_REF}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`GITHUB_SHA\` | \`${GITHUB_SHA}\` |" >> $GITHUB_STEP_SUMMARY
echo "| \`VERSION\` | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
build-docker:
name: Build and publish Docker image
needs: extract-version
runs-on: ${{ matrix.configs.runner }}
env:
VERSION: ${{ needs.extract-version.outputs.VERSION }}
permissions:
contents: read
packages: write
strategy:
matrix:
configs:
- target: linux/amd64
runner: warp-ubuntu-latest-x64-16x
- target: linux/arm64
runner: warp-ubuntu-latest-arm64-16x
steps:
- name: checkout sources
uses: actions/checkout@v4
- name: docker qemu
uses: docker/setup-qemu-action@v3
- name: docker buildx
uses: docker/setup-buildx-action@v3
- name: docker metadata
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
labels: org.opencontainers.image.source=${{ github.repositoryUrl }}
tags: |
type=sha
type=schedule,pattern=nightly
- name: docker login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker build and push op-rbuilder
uses: docker/build-push-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile
context: .
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ matrix.configs.target }}
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
RBUILDER_BIN=op-rbuilder