Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks_docker.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Build
name: Docker Build Check

on:
workflow_dispatch:
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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
Loading