Bump docker/build-push-action from 4 to 5 (#2) #18
Workflow file for this run
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: Docker | |
on: | |
push: | |
tags: [ 'v*' ] | |
workflow_dispatch: | |
inputs: | |
manual_tag: | |
description: 'Git tag to use for image build' | |
required: true | |
type: string | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup tag names | |
run: | | |
echo "IMAGE_NAME=${GITHUB_REPOSITORY#rggen/}" >> ${GITHUB_ENV} | |
echo "TAG=$(echo ${GITHUB_REF#refs/*/v} | sed -r -e 's|([0-9]+\.[0-9]+)\.[0-9]+-([0-9]+\.[0-9]+)\.[0-9]+-([0-9]+\.[0-9]+)\.[0-9]+|\1-\2-\3|g')" >> ${GITHUB_ENV} | |
echo "RGGEN_VERSION=$(echo ${GITHUB_REF#refs/*/v} | sed -r -e 's|([0-9]+\.[0-9]+).+|\1|g')" >> ${GITHUB_ENV} | |
- name: Setup meta data | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=raw,value=${{ env.TAG }} | |
type=raw,value=${{ env.RGGEN_VERSION }} | |
type=raw,value=latest | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |