Skip to content

Commit 9ceeb68

Browse files
authored
Add ci workflow to build independent docker images + nightly (#163)
* Add ci workflow to build independdent docker images + nightly * Update * More fixes
1 parent 102a5fb commit 9ceeb68

File tree

2 files changed

+89
-1
lines changed

2 files changed

+89
-1
lines changed

.github/workflows/checks_docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker Build
1+
name: Docker Build Check
22

33
on:
44
workflow_dispatch:
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Docker Build Release
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 1 * * *"
7+
8+
jobs:
9+
extract-version:
10+
name: Extract version
11+
runs-on: warp-ubuntu-latest-x64-16x
12+
outputs:
13+
VERSION: ${{ steps.extract_version.outputs.VERSION }}
14+
steps:
15+
- name: Extract version
16+
id: extract_version
17+
run: |
18+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
19+
VERSION="${GITHUB_REF#refs/tags/}"
20+
else
21+
VERSION="$(echo ${GITHUB_SHA} | cut -c1-7)"
22+
fi
23+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
24+
25+
echo "| | |" >> $GITHUB_STEP_SUMMARY
26+
echo "| ------------------- | ---------------------- |" >> $GITHUB_STEP_SUMMARY
27+
echo "| \`GITHUB_REF_TYPE\` | \`${GITHUB_REF_TYPE}\` |" >> $GITHUB_STEP_SUMMARY
28+
echo "| \`GITHUB_REF_NAME\` | \`${GITHUB_REF_NAME}\` |" >> $GITHUB_STEP_SUMMARY
29+
echo "| \`GITHUB_REF\` | \`${GITHUB_REF}\` |" >> $GITHUB_STEP_SUMMARY
30+
echo "| \`GITHUB_SHA\` | \`${GITHUB_SHA}\` |" >> $GITHUB_STEP_SUMMARY
31+
echo "| \`VERSION\` | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY
32+
33+
build-docker:
34+
name: Build and publish Docker image
35+
needs: extract-version
36+
runs-on: ${{ matrix.configs.runner }}
37+
env:
38+
VERSION: ${{ needs.extract-version.outputs.VERSION }}
39+
permissions:
40+
contents: read
41+
packages: write
42+
strategy:
43+
matrix:
44+
configs:
45+
- target: linux/amd64
46+
runner: warp-ubuntu-latest-x64-16x
47+
- target: linux/arm64
48+
runner: warp-ubuntu-latest-arm64-16x
49+
steps:
50+
- name: checkout sources
51+
uses: actions/checkout@v4
52+
53+
- name: docker qemu
54+
uses: docker/setup-qemu-action@v3
55+
56+
- name: docker buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: docker metadata
60+
uses: docker/metadata-action@v5
61+
id: meta
62+
with:
63+
images: ghcr.io/${{ github.repository }}
64+
labels: org.opencontainers.image.source=${{ github.repositoryUrl }}
65+
tags: |
66+
type=sha
67+
type=schedule,pattern=nightly
68+
69+
- name: docker login
70+
uses: docker/login-action@v3
71+
with:
72+
registry: ghcr.io
73+
username: ${{ github.actor }}
74+
password: ${{ secrets.GITHUB_TOKEN }}
75+
76+
- name: docker build and push op-rbuilder
77+
uses: docker/build-push-action@v5
78+
with:
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
81+
file: Dockerfile
82+
context: .
83+
labels: ${{ steps.meta.outputs.labels }}
84+
platforms: ${{ matrix.configs.target }}
85+
push: true
86+
tags: ${{ steps.meta.outputs.tags }}
87+
build-args: |
88+
RBUILDER_BIN=op-rbuilder

0 commit comments

Comments
 (0)