This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
Build Docker image #8
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: Build Docker image | |
on: | |
release: | |
types: [ published ] | |
permissions: | |
contents: read | |
packages: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
name: Build Docker image ${{ matrix.type }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- type: jre | |
dockerfile: Dockerfile | |
latest: latest=true | |
- type: native | |
dockerfile: Dockerfile-native | |
latest: latest=false | |
tags: | | |
type=semver,pattern={{raw}},suffix=-native | |
type=raw,value=native | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
flavor: ${{ matrix.latest }} | |
tags: ${{ matrix.tags }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ${{ matrix.dockerfile }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |