SponsorBlockServer/.github/workflows/docker-build.yml

48 lines
1.2 KiB
YAML
Raw Normal View History

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
permissions:
packages: write
2022-05-04 07:51:38 +02:00
steps:
- name: Checkout
uses: actions/checkout@v3
2022-05-04 07:51:38 +02:00
- name: Docker meta
id: meta
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
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
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 }}