Releases/2.1.0 (#79) #139
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: Build Docker Image | |
on: | |
push: | |
branches: [main, develop] | |
tags: | |
- 'v*' | |
paths-ignore: | |
# Any update here needs to be done for | |
# - `pull_request` see below | |
- '*.md' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/pull_request_template.md' | |
- '.github/stale.yml' | |
- 'LICENSE' | |
pull_request: | |
branches: [main, develop] | |
types: [opened, synchronize, reopened] | |
paths-ignore: | |
# Any update here needs to be done for | |
# - `push`see before | |
- '*.md' | |
- '.github/ISSUE_TEMPLATE/**' | |
- '.github/pull_request_template.md' | |
- '.github/stale.yml' | |
- 'LICENSE' | |
env: | |
DOCKER_IMAGE: consumerdataright/mock-data-recipient | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Docker Metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
${{ env.DOCKER_IMAGE }} | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
- name: Setup Docker QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
if: ${{ github.repository_owner == 'ConsumerDataRight' && github.event_name != 'pull_request' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push Docker image | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./Source | |
file: ./Source/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ github.repository_owner == 'ConsumerDataRight' && github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
- name: Docker Hub Description | |
if: ${{ github.repository_owner == 'ConsumerDataRight' && github.ref_name == 'main' }} | |
uses: peter-evans/dockerhub-description@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
repository: ${{ env.DOCKER_IMAGE }} | |
enable-url-completion: true |