forked from grafana/alloy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions steps for creating Linux build images. (grafana#2532)
- Loading branch information
Showing
2 changed files
with
66 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Create build images | ||
on: | ||
push: | ||
tags: | ||
- build-image/v* | ||
|
||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
linux_build_image: | ||
name: Create a Linux build image | ||
runs-on: | ||
labels: github-hosted-ubuntu-x64-small | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache: false | ||
|
||
- name: Get version from Git tag | ||
env: | ||
FULL_TAG: ${{ github.ref_name }} | ||
id: get_image_version | ||
run: echo "image_tag=${FULL_TAG##*/}" >> $GITHUB_OUTPUT | ||
|
||
- name: Login to DockerHub (from vault) | ||
uses: grafana/shared-workflows/actions/[email protected] | ||
|
||
- run: | | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
docker buildx create --name multiarch --driver docker-container --use | ||
docker buildx build --build-arg="GO_RUNTIME=golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:${{ steps.get_image_version.outputs.image_tag }} ./tools/build-image | ||
linux_build_image_boringcrypto: | ||
name: Create a Linux build image for boringcrypto | ||
runs-on: | ||
labels: github-hosted-ubuntu-x64-small | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache: false | ||
|
||
- name: Get version from Git tag | ||
env: | ||
FULL_TAG: ${{ github.ref_name }} | ||
id: get_image_version | ||
run: echo "image_tag=${FULL_TAG##*/}-boringcrypto" >> $GITHUB_OUTPUT | ||
|
||
- name: Login to DockerHub (from vault) | ||
uses: grafana/shared-workflows/actions/[email protected] | ||
|
||
- run: | | ||
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
docker buildx create --name multiarch --driver docker-container --use | ||
docker buildx build --build-arg="GO_RUNTIME=mcr.microsoft.com/oss/go/microsoft/golang:1.23.5-bullseye" --push --platform linux/amd64,linux/arm64 -t grafana/alloy-build-image:${{ steps.get_image_version.outputs.image_tag }} ./tools/build-image |