Skip to content

Fix the github action version #2

Fix the github action version

Fix the github action version #2

Workflow file for this run

name: "Build and Release"
on:
push:
tags:
- 'v*'
jobs:
build_and_push_images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
RELEASE_VERSION: "${{ github.ref_name }}"
GHCR_REPO: "ghcr.io/ragul28/jmeter-k8s-cluster"
strategy:
matrix:
file_tag:
- file: ./docker-files/master.Dockerfile
service: jmeter-master
context: ./docker-files
- file: ./docker-files/slave.Dockerfile
service: jmeter-slave
context: ./docker-files
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
- name: Build base docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./docker-files/base.Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_REPO }}/jmeter-base:${{ env.RELEASE_VERSION }}
cache-from: type=gha
cache-to: type=gha
if: github.event_name != 'pull_request'
- name: Set up Docker matrix buildx
uses: docker/setup-buildx-action@v3
with:
config-inline: |
[worker.oci]
max-parallelism = 2
- name: Matrix Build and push images
uses: docker/build-push-action@v5
with:
context: ${{ matrix.file_tag.context }}
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.GHCR_REPO }}/${{ matrix.file_tag.service }}:${{ env.RELEASE_VERSION }}