Skip to content

fix brutal download url #18

fix brutal download url

fix brutal download url #18

name: Build and Push Sing-box Docker Image
# Disabled automatic builds - manual trigger only
on:
push:
branches: [ main ]
paths:
- 'singbox/**'
- '.github/workflows/singbox-build-push.yml'
pull_request:
branches: [ main ]
paths:
- 'singbox/**'
- '.github/workflows/singbox-build-push.yml'
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get Sing-box version
id: singbox_version
run: |
SINGBOX_VERSION=$(curl -s https://api.github.com/repos/SagerNet/sing-box/releases/latest | jq -r .tag_name)
SINGBOX_VERSION=${SINGBOX_VERSION#v}
echo "SINGBOX_VERSION=${SINGBOX_VERSION}" >> $GITHUB_ENV
# - name: Get Alpine kernel version
# id: kernel_version
# run: |
# KERNEL_VERSION=$(docker run --rm alpine:latest sh -c "apk update >/dev/null && apk add --no-cache linux-lts-dev >/dev/null 2>&1 && ls /usr/src/linux-headers-* | sed 's/.*headers-\(.*\)-[0-9]-lts/\1/'")
# echo "KERNEL_VERSION=${KERNEL_VERSION}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./singbox
file: ./singbox/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
SINGBOX_VERSION=${{ env.SINGBOX_VERSION }}
tags: |
ghcr.io/${{ github.repository_owner }}/singbox:latest
ghcr.io/${{ github.repository_owner }}/singbox:${{ env.SINGBOX_VERSION }}