Skip to content

Commit

Permalink
Update docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed May 3, 2024
1 parent 742adac commit 71c8bd2
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,34 @@ on:
release:
types:
- released

workflow_dispatch:
inputs:
tag:
description: "The tag version you want to build"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get commit to build
id: ref
run: |
if [[ -z "${{ github.event.inputs.tag }}" ]]; then
ref=${{ github.ref_name }}
else
ref=${{ github.event.inputs.tag }}
fi
if [[ $ref == *"-"* ]]; then
tags=ghcr.io/sagernet/sing-box:latest-beta
else
tags=ghcr.io/sagernet/sing-box:latest
fi
tags="$tags\nghcr.io/sagernet/sing-box:$ref"
echo "::set-output name=ref::$ref"
echo "::set-output name=tags::$tags"
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
ref: ${{ steps.ref.outputs.ref }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Setup QEMU for Docker Buildx
Expand All @@ -33,7 +54,5 @@ jobs:
target: dist
build-args: |
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
tags: |
ghcr.io/sagernet/sing-box:latest
ghcr.io/sagernet/sing-box:${{ github.ref_name }}
tags: ${{ steps.ref.outputs.tags }}
push: true

0 comments on commit 71c8bd2

Please sign in to comment.