k6 Docker Builder #4
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
name: k6 Docker Builder | |
on: | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push container image | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/metrico/k6:latest | |
- uses: shrink/actions-docker-extract@v3 | |
id: extract | |
with: | |
image: ghcr.io/metrico/k6:latest | |
path: /usr/bin/k6 | |
- name: Upload Custom k6 | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ steps.extract.outputs.destination }}/k6 | |
name: latest | |
- name: Upload k6 to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ steps.extract.outputs.destination }}/k6 | |
asset_name: k6 | |
tag: latest |