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 }}
|
||||
@@ -7,59 +7,15 @@ on:
|
||||
|
||||
jobs:
|
||||
tags:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.fetcher.outputs.matrix }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: tags
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- run: bun i
|
||||
- id: fetcher
|
||||
run: bun .
|
||||
uses: ./.github/workflows/tags.yml
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: tags
|
||||
strategy:
|
||||
matrix: ${{fromJson(needs.tags.outputs.matrix)}}
|
||||
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
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v4
|
||||
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: ${{ matrix.tags }}
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
build-args: NGINX=${{ matrix.version }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
push: true
|
||||
nginx_version: ${{ matrix.version }}
|
||||
tags: ${{ matrix.tags }}
|
||||
secrets: inherit
|
||||
@@ -0,0 +1,18 @@
|
||||
name: PR Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
tags:
|
||||
uses: ./.github/workflows/tags.yml
|
||||
|
||||
build:
|
||||
needs: tags
|
||||
strategy:
|
||||
matrix: ${{fromJson(needs.tags.outputs.matrix)}}
|
||||
uses: ./.github/workflows/build.yml
|
||||
with:
|
||||
push: false
|
||||
nginx_version: ${{ matrix.version }}
|
||||
tags: ${{ matrix.tags }}
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Fetch Nginx Tags
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
matrix:
|
||||
description: JSON matrix of nginx versions and docker tags
|
||||
value: ${{ jobs.fetch.outputs.matrix }}
|
||||
|
||||
jobs:
|
||||
fetch:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.fetcher.outputs.matrix }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: tags
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- run: bun i
|
||||
- id: fetcher
|
||||
run: bun .
|
||||
Reference in New Issue
Block a user