2022-08-27 22:55:55 +08:00
|
|
|
name: Build Docker Images
|
2024-01-24 12:13:12 +08:00
|
|
|
|
2022-08-27 22:55:55 +08:00
|
|
|
on:
|
2024-01-24 12:13:12 +08:00
|
|
|
release:
|
|
|
|
types:
|
2024-02-24 21:51:39 +08:00
|
|
|
- released
|
2024-01-24 12:13:12 +08:00
|
|
|
|
2022-08-27 22:55:55 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-11-14 19:16:02 +08:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-08-27 22:55:55 +08:00
|
|
|
- name: Setup Docker Buildx
|
2023-09-17 13:12:03 +08:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2022-10-29 18:01:11 +08:00
|
|
|
- name: Setup QEMU for Docker Buildx
|
2023-09-17 13:12:03 +08:00
|
|
|
uses: docker/setup-qemu-action@v3
|
2022-08-27 22:55:55 +08:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-09-17 13:12:03 +08:00
|
|
|
uses: docker/login-action@v3
|
2022-08-27 22:55:55 +08:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Docker metadata
|
|
|
|
id: metadata
|
2023-09-17 13:12:03 +08:00
|
|
|
uses: docker/metadata-action@v5
|
2022-08-27 22:55:55 +08:00
|
|
|
with:
|
|
|
|
images: ghcr.io/sagernet/sing-box
|
|
|
|
- name: Build and release Docker images
|
2023-09-17 13:12:03 +08:00
|
|
|
uses: docker/build-push-action@v5
|
2022-08-27 22:55:55 +08:00
|
|
|
with:
|
2022-10-26 19:29:27 +08:00
|
|
|
platforms: linux/386,linux/amd64,linux/arm64,linux/s390x
|
2022-08-27 22:55:55 +08:00
|
|
|
target: dist
|
2023-11-14 10:34:38 +08:00
|
|
|
build-args: |
|
|
|
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
|
2022-10-29 18:01:11 +08:00
|
|
|
tags: |
|
2024-01-24 12:13:12 +08:00
|
|
|
ghcr.io/sagernet/sing-box:latest
|
|
|
|
ghcr.io/sagernet/sing-box:${{ github.ref_name }}
|
2022-10-26 19:29:27 +08:00
|
|
|
push: true
|