Skip to content

Commit 4f23c7b

Browse files
author
Xiaochong Wei
committed
Init
1 parent 6143799 commit 4f23c7b

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "yscope-image-build"
2+
3+
inputs:
4+
dockerfile_path:
5+
description: "Dockerfile relative path from the root of the project"
6+
required: true
7+
image_name_prefix:
8+
description: "Container image name prefix"
9+
required: true
10+
image_registry:
11+
default: "ghcr.io"
12+
description: "Container image registry"
13+
required: false
14+
image_registry_username:
15+
default: "${{github.actor}}"
16+
description: "Container image registry username"
17+
required: false
18+
image_registry_password:
19+
default: ""
20+
description: "Container image registry password"
21+
required: false
22+
platform_id:
23+
description: "Platform ID of the container (e.g. ubuntu)"
24+
required: true
25+
platform_version_id:
26+
description: "Platform VERSION_ID / VERSION_CODENAME of the container
27+
(e.g. jammy, focal, etc.)"
28+
required: true
29+
30+
runs:
31+
using: "composite"
32+
steps:
33+
- name: "Set up Docker Buildx"
34+
uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2"
35+
36+
- name: "Login to Image Registry"
37+
uses: "docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772"
38+
with:
39+
registry: "${{inputs.image_registry}}"
40+
username: "${{inputs.image_registry_username}}"
41+
password: "${{inputs.image_registry_password}}"
42+
43+
- name: "Sanitize Repository Name"
44+
id: "sanitization"
45+
shell: "bash"
46+
run: |
47+
# Docker doesn't support repository names with uppercase characters, so we convert the
48+
# name to lowercase here.
49+
echo "REPOSITORY=$(echo '${{github.repository}}' | tr '[:upper:]' '[:lower:]')" \
50+
>> "$GITHUB_OUTPUT"
51+
52+
- name: "Update Metadata"
53+
id: "meta"
54+
uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804"
55+
with:
56+
images: "${{inputs.image_registry}}/${{steps.sanitization.outputs.REPOSITORY}}\
57+
/${{inputs.image_name_prefix}}-x86-${{inputs.platform_id}}-${{inputs.platform_version_id}}"
58+
59+
- name: "Build and Push"
60+
uses: "docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4"
61+
with:
62+
context: "./"
63+
file: ${{dockerfile_path}}
64+
push: true
65+
tags: "${{steps.meta.outputs.tags}}"
66+
labels: "${{steps.meta.outputs.labels}}"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "presto-coordinator-runtime-image-build"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/presto-coordinator-runtime-image-build.yaml"
7+
- "docker/**/*"
8+
push:
9+
paths:
10+
- ".github/workflows/presto-coordinator-runtime-image-build.yaml"
11+
- "docker/**/*"
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: "${{github.workflow}}-${{github.ref}}"
16+
17+
# Cancel in-progress jobs for efficiency. Exclude the `release-0.293-clp-connector` branch so
18+
# that each commit to release-0.293-clp-connector is checked completely.
19+
cancel-in-progress: "${{github.ref != 'refs/heads/release-0.293-clp-connector'}}"
20+
21+
jobs:
22+
presto-coordinator-runtime-image:
23+
name: presto-coordinator-runtime-image
24+
runs-on: ubuntu-22.04
25+
steps:
26+
- uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
27+
with:
28+
submodules: "recursive"
29+
30+
- name: "Workaround actions/runner-images/issues/6775"
31+
shell: "bash"
32+
run: "chown $(id -u):$(id -g) -R ."
33+
34+
- uses: "./.github/actions/yscope-image-build"
35+
with:
36+
dockerfile_path: "./docker/Dockerfile"
37+
image_name_prefix: "yscope-presto-with-clp-connector-coordinator"
38+
image_registry: "ghcr.io"
39+
image_registry_username: "${{github.actor}}"
40+
image_registry_password: "${{secrets.GITHUB_TOKEN}}"
41+
platform_id: "centos"
42+
platform_version_id: "stream9"

0 commit comments

Comments
 (0)