mirror of
https://github.com/cupcakearmy/docker-static.git
synced 2026-07-04 22:45:35 +00:00
split into block and add pr preview
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
name: Docker Build Reusable
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
push:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
nginx_version:
|
||||
required: true
|
||||
type: string
|
||||
tags:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v4
|
||||
if: inputs.push
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v4
|
||||
if: inputs.push
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Docker Labels
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: |
|
||||
cupcakearmy/static
|
||||
ghcr.io/${{ github.repository }}
|
||||
tags: ${{ inputs.tags }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: ${{ inputs.push }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
build-args: NGINX=${{ inputs.nginx_version }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
Reference in New Issue
Block a user