2022-05-04 07:51:38 +02:00
|
|
|
# Based on https://github.com/ajayyy/sb-mirror/blob/main/.github/workflows/docker-build.yml
|
|
|
|
name: multi-build-docker
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
name:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
username:
|
|
|
|
required: true
|
|
|
|
type: string
|
2022-05-06 20:34:11 +02:00
|
|
|
folder:
|
|
|
|
required: true
|
|
|
|
type: string
|
2022-05-04 07:51:38 +02:00
|
|
|
secrets:
|
|
|
|
GH_TOKEN:
|
|
|
|
required: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_container:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-05-06 19:01:53 +02:00
|
|
|
uses: actions/checkout@v3
|
2022-05-04 07:51:38 +02:00
|
|
|
- name: Docker meta
|
|
|
|
id: meta
|
2022-05-06 19:01:53 +02:00
|
|
|
uses: docker/metadata-action@v4
|
2022-05-04 07:51:38 +02:00
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
ghcr.io/${{ inputs.username }}/${{ inputs.name }}
|
|
|
|
tags: |
|
|
|
|
type-raw,value=alpine
|
|
|
|
flavor: |
|
|
|
|
latest=true
|
|
|
|
- name: Login to GHCR
|
2022-05-06 19:01:53 +02:00
|
|
|
uses: docker/login-action@v2
|
2022-05-04 07:51:38 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: push
|
2022-05-06 19:01:53 +02:00
|
|
|
uses: docker/build-push-action@v3
|
2022-05-04 07:51:38 +02:00
|
|
|
with:
|
2022-05-06 20:34:11 +02:00
|
|
|
context: ${{ inputs.folder }}
|
2022-05-04 07:51:38 +02:00
|
|
|
push: true
|
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|