reduce unnessecary images and build-steps, also provide all changes t… #14
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 Images | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
on: | |
push: | |
paths: | |
- ".github/workflows/*.yaml" | |
- "Dockerfile" | |
pull_request: | |
paths: | |
- ".github/workflows/*.yaml" | |
- "Dockerfile" | |
env: | |
# Use docker.io for Docker Hub if empty | |
REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
IMAGE_NAME: ${{ github.repository }} | |
TARGET_PLATFORMS: linux/amd64,linux/arm64 | |
jobs: | |
sushi: | |
name: FSH Sushi | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
base: [alpine, ubuntu] | |
sushi: ["2.10.2", "3.0.0", "3.4.0", "3.5.0", "3.10.0", "3.11.0", "3.11.1"] | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Adds static libs for multi-platform builds | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ env.TARGET_PLATFORMS }} | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/fsh-sushi | |
tags: | | |
${{ matrix.sushi }}-${{ matrix.base }} | |
# Build and push Docker image with Buildx (push on tag) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
target: fsh-sushi-${{ matrix.base }} | |
build-args: SUSHI_VERSION=${{ matrix.sushi }} | |
ig-publisher: | |
name: IG Publisher | |
needs: sushi | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
base: [alpine, ubuntu] | |
sushi: ["2.10.2", "3.0.0", "3.4.0", "3.5.0", "3.10.0", "3.11.0", "3.11.1"] | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Adds static libs for multi-platform builds | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: ${{ env.TARGET_PLATFORMS }} | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/ig-publisher | |
tags: | | |
${{ matrix.sushi }}-${{ matrix.base }} | |
# Build and push Docker image with Buildx (push on tag) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
target: ig-publisher-${{ matrix.base }} | |
build-args: SUSHI_VERSION=${{ matrix.sushi }} |