Build Stack Images #10
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 Stack Images | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Docker image tag' | ||
required: false | ||
default: 'latest' | ||
type: string | ||
stack: | ||
description: 'Which stack to build (leave empty to build all)' | ||
required: false | ||
type: choice | ||
options: | ||
- all | ||
- angular-vanilla | ||
- nextjs-shadcn | ||
- nextjs-vanilla | ||
- nextjs-p5 | ||
- nextjs-pixi | ||
default: 'all' | ||
env: | ||
REGISTRY: ghcr.io | ||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
app: ${{ (inputs.stack == 'all' && fromJSON('[{"name":"angular-vanilla","dockerfile":"images/AngularVanillaDockerFile"},{"name":"nextjs-shadcn","dockerfile":"images/NextjsShadcnDockerFile"},{"name":"nextjs-vanilla","dockerfile":"images/NextjsVanillaDockerFile"},{"name":"nextjs-p5","dockerfile":"images/NextjsP5DockerFile"},{"name":"nextjs-pixi","dockerfile":"images/NextjsPixiDockerFile"}]')) || fromJSON(format('[{"name":"%s","dockerfile":"images/%sDockerFile"}]', inputs.stack, replace(inputs.stack, '-', ''))) }} | ||
Check failure on line 32 in .github/workflows/build-stack-images.yml
|
||
name: Build ${{ matrix.app.name }} Image | ||
permissions: | ||
contents: read | ||
packages: write | ||
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 for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ github.repository }}-pack-${{ matrix.app.name }} | ||
tags: | | ||
type=raw,value=${{ inputs.tag }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: frontend | ||
file: ${{ matrix.app.dockerfile }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |