test #45
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: Test build | |
on: push | |
jobs: | |
detect-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
# Expose matched filters as job 'variants' output variable | |
image_variants: ${{ steps.filter.outputs.changes }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
# https://github.com/marketplace/actions/paths-changes-filter#conditional-execution | |
id: filter | |
with: | |
# detect changes against last commit | |
base: ${{ github.ref }} | |
filters: | | |
Dockerfile: Dockerfile | |
Dockerfile-deb: Dockerfile-deb | |
build: | |
needs: detect-changes | |
name: Setup, Build | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
if : ${{ needs.detect-changes.outputs.image_variants != '[]' }} | |
strategy: | |
max-parallel: 6 | |
# select a core set of images to build | |
matrix: | |
IMAGE_VARIANT: ${{ fromJSON(needs.detect-changes.outputs.image_variants) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ${{ matrix.IMAGE_VARIANT }} | |
tags: quota-microservices | |
push: false | |
load: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Extract built package | |
uses: shrink/actions-docker-extract@v3 | |
id: extract | |
with: | |
image: quota-microservices | |
path: /output/. | |
destination: output | |
# Archive the built package | |
- name: Archive artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: compiled-artifacts | |
path: output |