-
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.
- Loading branch information
0 parents
commit b1199d7
Showing
3 changed files
with
90 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
context: | ||
required: true | ||
type: string | ||
dockerfile: | ||
required: true | ||
type: string | ||
name: | ||
required: true | ||
type: string | ||
platforms: | ||
required: false | ||
type: string | ||
default: "linux/amd64,linux/arm64" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ inputs.name }} | ||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- # Add support for more platforms with QEMU (optional) | ||
# https://github.com/docker/setup-qemu-action | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ inputs.context }} | ||
file: ${{ inputs.dockerfile }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
platforms: ${{ inputs.platforms }} |
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,18 @@ | ||
on: | ||
push: | ||
paths: | ||
- k6-influx/**/* | ||
branches: | ||
- "master" | ||
- "main" | ||
- "latest" | ||
release: | ||
types: | ||
- created | ||
jobs: | ||
build-tensorflow: | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
context: k6-influx | ||
dockerfile: k6-influx/Dockerfile | ||
name: k6-influx |
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,17 @@ | ||
# From https://github.com/grafana/xk6-output-influxdb/blob/5411750fc094bf48198b6b1e15a528732a1d1e20/Dockerfile | ||
# Licensed under Apache 2.0 License. See https://github.com/grafana/xk6-output-influxdb/blob/5411750fc094bf48198b6b1e15a528732a1d1e20/LICENSE | ||
|
||
FROM golang:1.20-alpine3.17 as builder | ||
WORKDIR $GOPATH/src/go.k6.io/k6 | ||
RUN apk --no-cache add git | ||
RUN go install go.k6.io/xk6/cmd/[email protected] | ||
RUN xk6 build --with github.com/grafana/[email protected] --output /tmp/k6 | ||
|
||
FROM alpine:3.17 | ||
RUN apk add --no-cache ca-certificates && \ | ||
adduser -D -u 12345 -g 12345 k6 | ||
COPY --from=builder /tmp/k6 /usr/bin/k6 | ||
|
||
USER 12345 | ||
WORKDIR /home/k6 | ||
ENTRYPOINT ["k6"] |