Bump docker/bake-action from 5 to 6 #42
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: CI | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
labels: | | |
maintainer=The Dockage Developers | |
images: | | |
dockage/mailcatcher | |
### versioning strategy | |
### push semver tag v3.2.1 on master (default branch) | |
# dockage/mailcatcher:2.2.0 | |
# dockage/mailcatcher:2.2 | |
# dockage/mailcatcher:2 | |
# dockage/mailcatcher:latest | |
### push semver pre-release tag v3.0.0-beta.1 on master (default branch) | |
# dockage/mailcatcher:3.0.0-beta.1 | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=ref,event=pr | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build images | |
uses: docker/bake-action@v6 | |
with: | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta.outputs.bake-file }} | |
- name: Docker Hub Description | |
uses: peter-evans/dockerhub-description@v4 | |
if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }} | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
short-description: ${{ github.event.repository.description }} |