forked from grafana/alloy
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.78 KB
/
create_build_image.yml
File metadata and controls
58 lines (50 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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
strategy:
matrix:
build:
- runtime: golang:1.24.4-alpine3.21
- runtime: mcr.microsoft.com/oss/go/microsoft/golang:1.24.4-bookworm
suffix: "-boringcrypto"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Remove unnecessary files
run: |
rm -rf /usr/share/dotnet
rm -rf "$AGENT_TOOLSDIRECTORY"
rm -rf /opt/ghc
rm -rf "/usr/local/share/boost"
rm -rf /opt/hostedtoolcache
- name: Get version from Git tag
env:
FULL_TAG: ${{ github.ref_name }}
id: get_image_version
run: echo "image_tag=${FULL_TAG##*/}${{ matrix.build.suffix }}" >> $GITHUB_OUTPUT
- name: Login to DockerHub (from vault)
uses: grafana/shared-workflows/actions/dockerhub-login@13fb504e3bfe323c1188bf244970d94b2d336e86 # dockerhub-login-v1.0.1
- name: Setup QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Create Linux build image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
platforms: linux/amd64,linux/arm64
context: ./tools/build-image
push: true
tags: grafana/alloy-build-image:${{ steps.get_image_version.outputs.image_tag }}
build-args: |
GO_RUNTIME=${{ matrix.build.runtime }}