Skip to content

bilibili-webhook docker镜像构建 #8

bilibili-webhook docker镜像构建

bilibili-webhook docker镜像构建 #8

name: bilibili-webhook docker镜像构建
on:
workflow_dispatch:
push:
branches:
- 'main'
paths:
- 'bilibili-webhook/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
felix2yu/bilibili-webhook
ghcr.io/felix2yu/bilibili-webhook
tags: |
type=raw,value=latest
type=schedule,pattern={{date 'YYYYMMDD'}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: ./bilibili-webhook
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}