Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
bcobzh committed Jul 18, 2024
1 parent d1d4634 commit fee1998
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
workflow_call:
inputs:
tags:
type: string
description: The Docker Tags (see docker/metadata-action@v4 for available values)
required: true

jobs:
build-k6:
runs-on: ubuntu-latest

steps:
- name: Build/Push
uses: coopTilleuls/action-docker-build-push@v10
with:
IMAGE_NAME: k6-runner
BUILD_CONTEXT: release
REGISTRY_JSON_KEY: ${{ secrets.GITHUB_TOKEN }}
IMAGE_REPOSITORY: ghcr.io/cooptilleuls



35 changes: 35 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CD
on:
push:
branches:
- main
tags:
- '*'

pull_request:
types: [ opened, reopened, synchronize, labeled ]

jobs:
remove-deploy-label:
name: Remove deploy label
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')
runs-on: ubuntu-latest
steps:
- uses: mondeja/remove-labels-gh-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
deploy
build:
name: Build
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy'))
uses: ./.github/workflows/build.yml
with:
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM grafana/xk6:latest as builder
RUN xk6 build --with github.com/grafana/xk6-redis --with github.com/grafana/xk6-output-prometheus-remote

FROM alpine:3.18 as release
RUN adduser -D -u 12345 -g 12345 k6
COPY --from=builder /xk6/k6 /usr/bin/k6
USER k6
WORKDIR /home/k6
ENTRYPOINT ["k6"]

0 comments on commit fee1998

Please sign in to comment.