mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-12-25 14:05:39 +08:00
9da349748a
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
name: Build Docker Images
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag:
|
|
description: "The tag version you want to build"
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
- name: Setup QEMU for Docker Buildx
|
|
uses: docker/setup-qemu-action@v2
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Docker metadata
|
|
id: metadata
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ghcr.io/sagernet/sing-box
|
|
- name: Get tag to build
|
|
id: tag
|
|
run: |
|
|
echo "latest=ghcr.io/sagernet/sing-box:latest" >> $GITHUB_OUTPUT
|
|
if [[ -z "${{ github.event.inputs.tag }}" ]]; then
|
|
echo "versioned=ghcr.io/sagernet/sing-box:${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "versioned=ghcr.io/sagernet/sing-box:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Build and release Docker images
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
platforms: linux/386,linux/amd64,linux/arm64,linux/s390x
|
|
target: dist
|
|
tags: |
|
|
${{ steps.tag.outputs.latest }}
|
|
${{ steps.tag.outputs.versioned }}
|
|
push: true
|