-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.08 KB
/
release.yaml
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
name: publish
on:
push:
branches:
- main
tags:
- v*
env:
REGISTRY: ghcr.io
IMAGE_NAME: grafana/k6build
jobs:
publish-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.9.1
- name: Log into ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
run: |
if [[ "$GITHUB_REF_TYPE" == "tag" ]]; then
IMAGE_VERSION=$GITHUB_REF_NAME
else
IMAGE_VERSION='latest'
fi
IMAGE_TAG="$REGISTRY/$IMAGE_NAME:${IMAGE_VERSION}"
docker buildx build -t $IMAGE_TAG --platform=linux/amd64,linux/arm64 --push .