3x-ui/.github/workflows/docker.yml
vados-dev 0932c60aa0
Correct CI_REGISTRY variable and enhance login script
Fix typo in CI_REGISTRY variable and update login command.
2026-05-16 02:07:36 +03:00

94 lines
2.8 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={{version}},value=v0.0.1
# use custom value and match part of it
type=semver,pattern={{version}},value=p1/v0.0.1,match=v(\d.\d.\d)$
type=ref,event=branch
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="$(echo "${{ env.CI_REGISTRY }}")"
reg_user="$(echo "${{ 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 }}