Skip to content

Commit 0ea1ce0

Browse files
committed
feat: add GitHub Actions workflow for publishing Build Tools Docker image
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
1 parent c448226 commit 0ea1ce0

1 file changed

Lines changed: 76 additions & 0 deletions

File tree

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Publish Build Tools Docker Image
16+
17+
on:
18+
workflow_dispatch:
19+
inputs:
20+
ubuntu_version:
21+
description: 'Ubuntu version for base image'
22+
required: true
23+
bazel_version:
24+
description: 'Bazel version to build'
25+
required: true
26+
platforms:
27+
description: 'Target platforms (comma-separated)'
28+
required: false
29+
default: 'linux/s390x'
30+
draft:
31+
description: 'Draft mode (true: build only, false: build and push)'
32+
type: boolean
33+
required: false
34+
default: true
35+
36+
jobs:
37+
publish:
38+
runs-on: ubuntu-24.04-16core
39+
permissions:
40+
contents: read
41+
packages: write
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
46+
- name: Generate tag
47+
id: tag
48+
run: |
49+
TAG="ubuntu-${{ github.event.inputs.ubuntu_version }}-bazel-${{ github.event.inputs.bazel_version }}"
50+
echo "tag=$TAG" >> $GITHUB_OUTPUT
51+
52+
- name: Login to GitHub Container Registry
53+
if: ${{ !github.event.inputs.draft }}
54+
uses: docker/login-action@v3
55+
with:
56+
registry: ghcr.io
57+
username: ${{ github.actor }}
58+
password: ${{ secrets.GITHUB_TOKEN }}
59+
60+
- name: Set up Docker Buildx
61+
uses: docker/setup-buildx-action@v3
62+
63+
- name: Build and Push Docker Image
64+
uses: docker/build-push-action@v6
65+
with:
66+
context: .
67+
file: bazel/external/Dockerfile.bazel
68+
platforms: ${{ github.event.inputs.platforms }}
69+
tags: ghcr.io/proxy-wasm/build-tools:${{ steps.tag.outputs.tag }}
70+
build-args: |
71+
UBUNTU_VERSION=${{ github.event.inputs.ubuntu_version }}
72+
BAZEL_VERSION=${{ github.event.inputs.bazel_version }}
73+
push: ${{ !github.event.inputs.draft }}
74+
load: ${{ github.event.inputs.draft }}
75+
cache-from: type=gha,scope=build-tools-${{ steps.tag.outputs.tag }}
76+
cache-to: type=gha,mode=max,scope=build-tools-${{ steps.tag.outputs.tag }}

0 commit comments

Comments
 (0)