Update to FakeSMTP 2.3.4 #11
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 Publish & GitHub Release | |
on: | |
push: | |
tags: | |
- '**' | |
env: | |
IMAGE_NAME: ghusta/fakesmtp | |
ENABLE_QEMU: 1 | |
jobs: | |
docker-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- # Add support for more platforms with QEMU (optional) | |
# https://github.com/marketplace/actions/docker-setup-qemu | |
name: Set up QEMU | |
if: ${{ env.ENABLE_QEMU == '1' }} | |
uses: docker/setup-qemu-action@v3 | |
# https://github.com/marketplace/actions/docker-setup-buildx | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
# https://github.com/marketplace/actions/docker-login | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/marketplace/actions/docker-metadata-action | |
- name: Extract Docker metadata / suffix jre21 | |
id: meta-jre21 | |
uses: docker/metadata-action@v5 | |
env: | |
TAG_SUFFIX: '-jre21' | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=true | |
tags: | | |
# semver-only tags | |
type=semver,pattern={{version}} | |
type=semver,pattern={{version}},suffix=${{ env.TAG_SUFFIX }} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}}.{{minor}},suffix=${{ env.TAG_SUFFIX }} | |
# Build and push Docker image with Buildx | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker images (multi-architecture) / jre21 | |
id: build-and-push-jre21 | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
build-args: | | |
JAVA_IMAGE_TAG=21-jre | |
platforms: | | |
linux/amd64 | |
linux/arm64/v8 | |
push: true | |
provenance: false | |
tags: ${{ steps.meta-jre21.outputs.tags }} | |
labels: ${{ steps.meta-jre21.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Extract Docker metadata / suffix jre17 | |
id: meta-jre17 | |
uses: docker/metadata-action@v5 | |
env: | |
TAG_SUFFIX: '-jre17' | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
suffix=${{ env.TAG_SUFFIX }} | |
tags: | | |
# semver-only tags | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
# Build and push Docker image with Buildx | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker images (multi-architecture) / jre17 | |
id: build-and-push-jre17 | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
build-args: | | |
JAVA_IMAGE_TAG=17-jre | |
platforms: | | |
linux/amd64 | |
linux/arm64/v8 | |
linux/arm/v7 | |
push: true | |
provenance: false | |
tags: ${{ steps.meta-jre17.outputs.tags }} | |
labels: ${{ steps.meta-jre17.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Extract Docker metadata / suffix jre11 | |
id: meta-jre11 | |
uses: docker/metadata-action@v5 | |
env: | |
TAG_SUFFIX: '-jre11' | |
with: | |
images: ${{ env.IMAGE_NAME }} | |
flavor: | | |
latest=false | |
suffix=${{ env.TAG_SUFFIX }} | |
tags: | | |
# semver-only tags | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
# Build and push Docker image with Buildx | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker images (multi-architecture) / jre11 | |
id: build-and-push-jre11 | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
build-args: | | |
JAVA_IMAGE_TAG=11-jre | |
platforms: | | |
linux/amd64 | |
linux/arm64/v8 | |
linux/arm/v7 | |
push: true | |
provenance: false | |
tags: ${{ steps.meta-jre11.outputs.tags }} | |
labels: ${{ steps.meta-jre11.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
create-github-release: | |
needs: [ docker-publish ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# https://github.com/actions/create-release | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: ${{ github.ref_name }} | |
body: | | |
Docker image published: | |
![Docker Image Version (tag latest semver)](https://img.shields.io/docker/v/${{ env.IMAGE_NAME }}/${{ github.ref_name }}?logo=docker) | |
Pull it with: | |
```shell | |
docker pull ${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
``` | |
Alternatively, you can pull an image with a given JRE: | |
```shell | |
docker pull ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-jre21 | |
``` | |
```shell | |
docker pull ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-jre17 | |
``` | |
```shell | |
docker pull ${{ env.IMAGE_NAME }}:${{ github.ref_name }}-jre11 | |
``` | |
draft: false | |
prerelease: false |