mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
93 lines
2.7 KiB
YAML
93 lines
2.7 KiB
YAML
name: Release 3X-UI for Docker
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
env:
|
|
CI_IMAGE_NAME: "3x-ui"
|
|
CI_REGISTRY: "reg.vados.ru"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v6
|
|
env:
|
|
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
|
registry: ${{ env.CI_RETGISTRY }}
|
|
image: ${{ env.CI_IMAGE_NAME }}
|
|
with:
|
|
images: |
|
|
${registry}/${image}
|
|
flavor: |
|
|
latest=true
|
|
tags: |
|
|
# set latest tag for default branch
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
# use custom value instead of git tag
|
|
type=semver,pattern=v{{version}},value=v0.0.1
|
|
# use custom value and match part of it
|
|
type=semver,pattern=v{{version}},value=v0.0.1,match=v(\d.\d.\d)$
|
|
type=ref,event=tag
|
|
labels: |
|
|
maintainer=${GITHUB_REPOSITORY_OWNER}
|
|
org.opencontainers.image.url=${registry}/${image}:
|
|
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
|
|
|
|
# type=semver,pattern={{version}}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
|
|
- name: Login to registry
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
reg_url="${{ env.CI_REGISTRY }}"
|
|
reg_user="${{ vars.REG_USER }}"
|
|
echo "${{ secrets.REG_PASS }}" | docker login $reg_url -u $user --password-stdin
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64
|
|
# images: ${{ steps.meta.outputs.images }}:${{ steps.meta.outputs.tags }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
annotations: ${{ steps.meta.outputs.annotations }}
|
|
|
|
# uses: docker/login-action@v2
|
|
# with:
|
|
# registry: reg.vados.ru
|
|
# username: ${{ vars.REG_USER }}
|
|
# password: ${{ secrets.REG_PASS }}
|
|
# scope: '${IMAGE_NAME}@push'
|
|
|
|
# - name: Login to registries
|
|
# uses: docker/login-action@v4
|
|
# with:
|
|
# registry-auth: |
|
|
# - username: ${{ vars.DOCKER_HUB_USERNAME }}
|
|
# password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
|
# - registry: ghcr.io
|
|
# username: ${{ github.actor }}
|
|
# password: ${{ secrets.GITHUB_TOKEN }}
|
|
|