github.com/inazumav/sing-box@v0.0.0-20230926072359-ab51429a14f1/.github/workflows/docker.yml (about)

     1  name: Build Docker Images
     2  on:
     3    workflow_dispatch:
     4      inputs:
     5        tag:
     6          description: "The tag version you want to build"
     7  jobs:
     8    build:
     9      runs-on: ubuntu-latest
    10      steps:
    11        - name: Checkout
    12          uses: actions/checkout@v3
    13        - name: Setup Docker Buildx
    14          uses: docker/setup-buildx-action@v2
    15        - name: Setup QEMU for Docker Buildx
    16          uses: docker/setup-qemu-action@v2
    17        - name: Login to GitHub Container Registry
    18          uses: docker/login-action@v2
    19          with:
    20            registry: ghcr.io
    21            username: ${{ github.repository_owner }}
    22            password: ${{ secrets.GITHUB_TOKEN }}
    23        - name: Docker metadata
    24          id: metadata
    25          uses: docker/metadata-action@v4
    26          with:
    27            images: ghcr.io/inazumav/sing-box
    28        - name: Get tag to build
    29          id: tag
    30          run: |
    31            echo "latest=ghcr.io/inazumav/sing-box:latest" >> $GITHUB_OUTPUT
    32            if [[ -z "${{ github.event.inputs.tag }}" ]]; then
    33              echo "versioned=ghcr.io/inazumav/sing-box:${{ github.ref_name }}" >> $GITHUB_OUTPUT
    34            else
    35              echo "versioned=ghcr.io/inazumav/sing-box:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
    36            fi
    37        - name: Build and release Docker images
    38          uses: docker/build-push-action@v4
    39          with:
    40            platforms: linux/386,linux/amd64,linux/arm64,linux/s390x
    41            target: dist
    42            tags: |
    43              ${{ steps.tag.outputs.latest }}
    44              ${{ steps.tag.outputs.versioned }}
    45            push: true